Hi!
We use Hibernate 2.1.
This is part of my mapping document:
Code:
<class name="com.orionbilling.server.model.account.Subscription" table="subscription">
<id name="id" column="id" type="java.lang.Long">
<generator class="native">
</id>
<map name="networkIdentifiers" table="network_identifier">
<key column="subscription_id"/>
<index type="com.orionbilling.common.TimeIntervalType">
<column name="start_date"/>
<column name="end_date"/>
</index>
<composite-element class="com.orionbilling.server.model.account.NetworkIdentifier">
<property name="imsi" type="string" column="imsi"/>
<property name="phoneNumber" type="string" column="phone_number"/>
</composite-element>
</map>
...
</class>
Schema export tool generates for NetworkIdentifier component such table:
Code:
create table network_identifier (
subscription_id NUMBER(19,0) not null,
imsi VARCHAR2(15),
phone_number VARCHAR2(15),
start_date DATE not null,
end_date DATE not null,
primary key (subscription_id, start_date, end_date)
);
but by our business requirements 'end_date' can be null and it is not necessary to be it in the primary key of 'network_identifier' table. Is their some way to specify that 'end_date' column shouldn't be included in the part of 'network_identifier' primary key? I understand that my case is a pretty exotic, but may be I missed something in the documentation or Hibernate examples and it's possible to do.
Best Regards,
Den Orlov