-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Don't understand how names for FK are generated
PostPosted: Sun Feb 26, 2006 9:24 am 
Beginner
Beginner

Joined: Fri Jun 25, 2004 11:47 am
Posts: 34
Hi,

I've the following tables:
INSTRUMENT(
ID (PK),
BASE_CURRENCY (FK),
UNDERLYING_CURRENCY
)

CURRENCY(
ID(PK),
ISO_CODE_3,
NAME
)

Where relation between the tables are as follow:
INSTRUMENT.BASE_CURRENCY -0..1-> CURRENCY.ID
INSTRUMENT.UNDERLYING_CURRENCY -0..1-> CURRENCY.ID

When running hibernate tool, I'm getting the following code generation:

@Entity

@Inheritance(strategy=InheritanceType.SINGLE_TABLE)

@DiscriminatorColumn(name="DISCRIMINATOR", discriminatorType=DiscriminatorType.INTEGER)

@Table(name="INSTRUMENT", uniqueConstraints = { @UniqueConstraint( columnNames = { "CODE" } ) })

public class Instrument implements java.io.Serializable {

// Fields

private long id;

private InstrumentType instrumentType;

private Currency currencyByBaseCurrency;

private Currency currencyByUnderlyingCurrency;
...

My question is why the names for the currencies are currencyByBaseCurrency, currencyByUnderlyingCurrency
when I'm expecting to have baseCurrency and underlyingCurrency?

Best regards


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 26, 2006 11:00 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
good question...from your description i would say it should just work.

could you put it in jira ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 27, 2006 4:45 am 
Beginner
Beginner

Joined: Fri Jun 25, 2004 11:47 am
Posts: 34
Hi,

I've just created the following item HBX-608.
Hope that will help.

Best regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.