Hibernate version:
HIbernate 2.1.4
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping package="vobjects">
<class name="VObjectAlltypes" table="sspa_alltypes">
<id name="id" column="alltypes_id" type="string">
<generator class="uuid.hex"/>
</id>
<property name="lastModified" column="last_modified"/>
<property name="modifierId" column="modifier_id"/>
<property name="otherId" column="other_id"/>
<property name="dtShort" column="dt_short"/>
<property name="dtLong" column="dt_long"/>
<property name="dtInteger" column="dt_integer"/>
<property name="dtString" column="dt_string"/>
<property name="dtBoolean" column="dt_boolean"/>
<property name="dtString1" column="dt_string1"/>
<property name="dtString2" column="dt_string2"/>
<property name="dtString3" column="dt_string3"/>
<property name="dtString4" column="dt_string4"/>
<property name="dtString5" column="dt_string5"/>
<property name="dtString6" column="dt_string6"/>
<list name="SometypesList" table="sspa_all_some" lazy="true" inverse="false">
<key column="sometypes_id"/>
<index column="colIdx"/>
<many-to-many column="alltypes_id" class="vobjects.VObjectSometypes"/>
</list>
</class>
</hibernate-mapping>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping package="vobjects">
<class name="VObjectSometypes" table="sspa_sometypes">
<id name="id" column="sometypes_id" type="string">
<generator class="uuid.hex"/>
</id>
<property name="lastModified" column="last_modified"/>
<property name="modifierId" column="modifier_id"/>
<property name="dtShort" column="dt_short"/>
<property name="dtLong" column="dt_long"/>
<property name="dtInteger" column="dt_integer"/>
<property name="dtString" column="dt_string"/>
<property name="dtBoolean" column="dt_boolean"/>
<property name="dtStringClob" column="dt_string_clob"/>
<list name="AlltypesList" table="sspa_all_some" lazy="true" inverse="true">
<key column="alltypes_id"/>
<index column="colIdx"/>
<many-to-many column="sometypes_id" class="vobjects.VObjectAlltypes"/>
</list>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Adaptive Server Anywhere Network Server Version 9.0.1.1751
The generated SQL (show_sql=true):
Buildfile: c:\nvdt\build.xml
run_schemaexport_tool:
[echo] ===== Running the schemaexport to update schema in database =====
[schemaexport] Sep 18, 2004 9:21:26 AM net.sf.hibernate.cfg.Environment <clinit>
[schemaexport] INFO: Hibernate 2.1.4
[schemaexport] Sep 18, 2004 9:21:26 AM net.sf.hibernate.cfg.Environment <clinit>
[schemaexport] drop table sspa_alltypes;
[schemaexport] drop table sspa_sometypes;
[schemaexport] drop table sspa_all_some;
[schemaexport] create table sspa_alltypes (
[schemaexport] alltypes_id VARCHAR(255) not null,
[schemaexport] last_modified DATETIME null,
[schemaexport] modifier_id VARCHAR(255) null,
[schemaexport] other_id VARCHAR(255) null,
[schemaexport] dt_short SMALLINT null,
[schemaexport] dt_long NUMERIC(19,0) null,
[schemaexport] dt_integer INT null,
[schemaexport] dt_string VARCHAR(255) null,
[schemaexport] dt_boolean TINYINT null,
[schemaexport] dt_string1 VARCHAR(255) null,
[schemaexport] dt_string2 VARCHAR(255) null,
[schemaexport] dt_string3 VARCHAR(255) null,
[schemaexport] dt_string4 VARCHAR(255) null,
[schemaexport] dt_string5 VARCHAR(255) null,
[schemaexport] dt_string6 VARCHAR(255) null,
[schemaexport] primary key (alltypes_id)
[schemaexport] );
[schemaexport] create table sspa_sometypes (
[schemaexport] sometypes_id VARCHAR(255) not null,
[schemaexport] last_modified DATETIME null,
[schemaexport] modifier_id VARCHAR(255) null,
[schemaexport] dt_short SMALLINT null,
[schemaexport] dt_long NUMERIC(19,0) null,
[schemaexport] dt_integer INT null,
[schemaexport] dt_string VARCHAR(255) null,
[schemaexport] dt_boolean TINYINT null,
[schemaexport] dt_string_clob VARCHAR(255) null,
[schemaexport] primary key (sometypes_id)
[schemaexport] );
[schemaexport] create table sspa_all_some (
[schemaexport] sometypes_id VARCHAR(255) not null,
[schemaexport] alltypes_id VARCHAR(255) not null,
[schemaexport] colIdx INT not null,
[schemaexport] primary key (alltypes_id, colIdx)
[schemaexport] );
[schemaexport] alter table sspa_all_some add constraint FKBE1F8900DE406342 foreign key (alltypes_id) references sspa_sometypes;
[schemaexport] alter table sspa_all_some add constraint FKBE1F89005DF9DB95 foreign key (sometypes_id) references sspa_alltypes;
Results from query to database showing that only alltypes_id and colIdx are composist pri ary keys.
table_id,column_id,pkey,domain_id,nulls,width,scale,unused,max_identity,column_name,remarks,default,unused2,user_type,format_str,column_type,remote_name,remote_type
441,1,'N',9,'N',255,0,0,0,'sometypes_id',,,,,,'R',,
441,2,'Y',9,'N',255,0,0,0,'alltypes_id',,,,,,'R',,
441,3,'Y',2,'N',4,0,0,0,'colIdx',,,,,,'R',,
Debug level Hibernate log excerpt:
_________________ Mousa
|