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
|