Postgres multiple schemas

100 views
Skip to first unread message

Joseph Conley

unread,
Feb 8, 2012, 3:31:03 PM2/8/12
to eb...@googlegroups.com
I am trying to use Ebean with a Postgres database which has multiple schemas.  I wanted to take the approach of using one EbeanServer per schema; however, the postgres jdbc driver does not allow the specification of a schema in its url/configuration.  I've tried running sql after creating each server to correct this i.e. set search_path to <schema>, however this doesn't work.  Is there a standard approach in Ebean to deal with this Postgres issue?

edge

unread,
Feb 8, 2012, 3:39:35 PM2/8/12
to Ebean ORM
I'm not quite sure I understand the problem but you can define the
schema using the @Table annotation
Alternatively, if you want to dynamically et schema, table name etc
then create your own NamingConvention - you can derive from e.g.
UnderscoreNamingConvention

Joseph Conley

unread,
Feb 8, 2012, 4:55:40 PM2/8/12
to eb...@googlegroups.com
I was hoping to avoid having to annotate every class with Table annotations if it wasn't necessary.   A custom naming convention worked like a charm. Thanks!
Reply all
Reply to author
Forward
0 new messages