Skip to main content

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
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'


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: Mon Apr 12 23:17:49 GMT 2021

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

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

Back to the top