Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » how to change default schema - postgresql
how to change default schema - postgresql [message #675234] Mon, 30 May 2011 20:46 Go to next message
Eclipse User is currently offline Eclipse UserFriend
Messages: 1
Registered: May 2011
Junior Member
Hi,
is there a way to change default schema in persistence.xml for postgresql database ?
Re: how to change default schema - postgresql [message #676034 is a reply to message #675234] Thu, 02 June 2011 15:06 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Normally the default schema used is the one that the user connects to be default, which is configured on the database, or in the connect URL.

ALTER USER user_name SET search_path to 'schema'

jdbc:postgresql://localhost:5432/mydatabase?searchpath=myschema

In JPA you can set the default schema in the orm.xml, if you want the table qualified in all SQL.
In EclipseLink you can also set a table-qualifier using a SessionCustomizer from your persistence.xml and the API session.getLogin().setTableQualifier(mySchema).


James : Wiki : Book : Blog : Twitter
Previous Topic:Create Canonical Metamodel without using any JPA/EclipseLink Annotations
Next Topic:EclipseLink with JSR 303 - Bean Validation in an RCP environment
Goto Forum:
  


Current Time: Sat Dec 20 01:00:00 GMT 2014

Powered by FUDForum. Page generated in 0.01596 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software