Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » eclipselink generates table on the wrong schema
eclipselink generates table on the wrong schema [message #730635] Wed, 28 September 2011 18:43 Go to next message
Luiz E. is currently offline Luiz E.Friend
Messages: 97
Registered: September 2010
Member
hi all.
i have a relation like this

@Entity
@Table(schema="ecf")
public class ImpressoraFiscal implements Serializable{
	private static final long serialVersionUID = 6246259319048104042L;
	
	@OneToMany(cascade={CascadeType.ALL}, orphanRemoval=true)
	private List<Aliquota> aliquotas = new ArrayList<Aliquota>();



and
@Entity
@Table(schema="ecf")
public class Aliquota implements Serializable {
	private static final long serialVersionUID = -1473589350884030504L;
	
	@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;


and as you can see, both table are in 'ecf' schema. this kind of relationship generates a table like 'ImpressoraFiscal_Aliquota'. so far, everything is ok
but this is weird: this table 'ImpressoraFiscal_Aliquota' is generated on 'public' schema (i'm using postgre)
is this the expected behavior?

thanks in advanced
Re: eclipselink generates table on the wrong schema [message #730876 is a reply to message #730635] Thu, 29 September 2011 12:09 Go to previous messageGo to next message
Guy Pelletier is currently offline Guy PelletierFriend
Messages: 19
Registered: July 2009
Junior Member
The behavior is correct since you are allowing the join table to default on the OneToMany. You'll need to add @JoinTable(schema="ecf") to have it in the same schema.

Alternatively, you can specify a schema default in XML under the <persistence-unit-defaults> to apply to all your tables.

Cheers,
Guy
Re: eclipselink generates table on the wrong schema [message #731043 is a reply to message #730876] Thu, 29 September 2011 18:43 Go to previous message
Luiz E. is currently offline Luiz E.Friend
Messages: 97
Registered: September 2010
Member
thank you!
the @JoinTable did the trick!
Previous Topic:Problem JRE up to 6u18 on Java Web Start
Next Topic:eclipselink generates table on the wrong schema
Goto Forum:
  


Current Time: Fri Dec 19 03:30:41 GMT 2014

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

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