-->
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.  [ 2 posts ] 
Author Message
 Post subject: having a problem with union subclass - can any one advise
PostPosted: Mon Mar 21, 2005 3:22 pm 
Newbie

Joined: Fri Mar 04, 2005 7:10 am
Posts: 12
design - I have created a superclass called job - which is abstract. This has various subtypes (e.g. request, customerOrder, supply order) etc

I also do a similar thing with joblines with subtypes supplierOrderLines, and customerOrderLines

when the parser hits the many to one ref in the union subtype in any of the job line descendents to reference the subtype instance in the jobs hieracrhcy then I get an error from the build

e.g. supplierOrderLines - has many to one reference to supplierOrder i get an error saying it doesnt understand the class referenced - despite the fact that the. If i comment out this reference then it all works fine (though i dont get the foreign key in the supplierOrderLine back to the supplierOrder.

I cant figure out why the parser cant see the class - as the jobs.orders.CustomerOrder as a java class does exist as a java file, and the tables get created in the DB but i get this error when declare the many to one ref.


Hibernate version:v3rc1

Mapping documents:

here is the mapping file of the supertype and the union subtypes for the job class and children

Code:

<hibernate-mapping  package="jobs">
   
   <class name="Job" abstract="true" table="Job">
      <id name="jobID" type="long" column="jobID" unsaved-value="0">
         <generator class="hilo">
            <param name="table">job_hi_value</param>
            <param name="column">next_value</param>
            <param name="max_lo">0</param>      
         </generator>
      </id>


      <version name="version"
                 type="int"
                 column="job_version"/>

      <!-- request job -->
      <union-subclass  name="jobs.request.Request" table="Request" extends="Job">

         <property name="key" type = "long" column = "req_uniqueKey" length="100"/>
         <property name="jobName" type = "java.lang.String" column = "req_jobName" length="100"/>
         <property name="jobAlias" type = "java.lang.String" column="req_jobNameAlias" length="100" />

         <map name="flexAtt" table="ReqAttVals" cascade="all">
            <key column="reqav_jobID"/>
            <map-key column="reqav_attribute" type="java.lang.String"/>
            <element column="reqdav_value" type="java.lang.String"/>
         </map>

         <map name="dates" table="RequestDates" cascade="all">
            <key column="req_jobID"/>
            <map-key column="req_dateName" type="java.lang.String"/>
            <element column="req_dateValue" type="java.util.Date"/>
         </map>

         <!-- appear to have to reference the base class not the sub -->
         <many-to-one name="customer" class="customer.Organisation" column="req_orgID"  cascade="all" lazy = "true"/>

         <set name="customerOrders" table="CustomerOrder" cascade="all" inverse="true" lazy = "true">
            <key column="cusord_reqID"/>
            <one-to-many class="jobs.order.CustomerOrder"/>
         </set>

      </union-subclass>

                 
      <!-- customer order job -->
      <union-subclass  name="jobs.order.CustomerOrder" table="CustomerOrder" extends="Job">

         <property name="key" type = "long" column = "cusord_uniqueKey" length="100"/>
         <property name="jobName" type = "java.lang.String" column = "cusord_jobName" length="100"/>
         <property name="jobAlias" type = "java.lang.String" column="cusord_jobNameAlias" length="100" />


         <map name="flexAtt" table="CusOrdAttVals" cascade="all">
            <key column="cusordav_jobID"/>
            <map-key column="cusordav_attribute" type="java.lang.String"/>
            <element column="cusordav_value" type="java.lang.String"/>
         </map>

         <map name="dates" table="CusOrdDates" cascade="all">
            <key column="cusord_jobID"/>
            <map-key column="cusord_dateName" type="java.lang.String"/>
            <element column="cusord_dateValue" type="java.util.Date"/>
         </map>


         <many-to-one name="customer" class="customer.Organisation" column="cusord_orgID"  cascade="all" lazy = "true"/>


         <set name="supplyOrders" table="SupplyOrder" cascade="all" inverse="true" lazy = "true">
            <key column="supord_cusOrdID"/>
            <one-to-many class="jobs.order.SupplyOrder"/>
         </set>

   
      </union-subclass>


      <!-- supply order job -->
      <union-subclass  name="jobs.order.SupplyOrder" table="SupplyOrder" extends="Job">

         <property name="key" type = "long" column = "supord_uniqueKey" length="100"/>
         <property name="jobName" type = "java.lang.String" column = "supord_jobName" length="100"/>
         <property name="jobAlias" type = "java.lang.String" column="supord_jobNameAlias" length="100" />

         <map name="flexAtt" table="SupOrdAttVals" cascade="all">
            <key column="supordav_jobID"/>
            <map-key column="supordav_attribute" type="java.lang.String"/>
            <element column="supordav_value" type="java.lang.String"/>
         </map>

         <map name="dates" table="SupOrdDates" cascade="all">
            <key column="supord_jobID"/>
            <map-key column="supord_dateName" type="java.lang.String"/>
            <element column="supord_dateValue" type="java.util.Date"/>
         </map>


         <many-to-one name="customer" class="customer.Organisation" column="supord_orgID"  cascade="all" lazy = "true"/>
         
      </union-subclass>


   </class>
</hibernate-mapping>





the job lines defn is
Code:

<hibernate-mapping  package="jobs">
   
   <class name="JobLine" abstract="true" table="JobLine">
      <id name="jobLineID" type="long" column="jobLineID" unsaved-value="0">
         <generator class="hilo">
            <param name="table">job_hi_value</param>
            <param name="column">next_value</param>
            <param name="max_lo">0</param>      
         </generator>
      </id>


      <version name="version"
                 type="int"
                 column="jobline_version"/>

      <!-- customer order line  -->
      <union-subclass  name="jobs.order.CustomerOrderLine" table="CustomerOrderLine" extends="job.Job">

         <property name="key" type = "long" column = "col_uniqueKey" length="100"/>
         <property name="coLineNumber" type = "int" column = "col_lineNumber" />

         <map name="flexAtt" table="ColAttVals" cascade="all">
            <key column="colav_colID"/>
            <map-key column="colav_attribute" type="java.lang.String"/>
            <element column="colav_value" type="java.lang.String"/>
         </map>

         <map name="dates" table="RequestDates" cascade="all">
            <key column="coldate_colID"/>
            <map-key column="coldate_dateName" type="java.lang.String"/>
            <element column="coldate_dateValue" type="java.util.Date"/>
         </map>

         <many-to-one name="customerOrder" class="jobs.order.CustomerOrder" column="col_coID"  cascade="all" lazy = "true"/> 
         <!--<many-to-one name="containingCpe" class="inventory.CPE" column="itemi_cpeID"  cascade="all" lazy = "true"/> -->

      </union-subclass>

                 

      <!-- supply order line -->
      <union-subclass  name="jobs.order.SupplyOrderLine" table="SupplyOrderLine" extends="Job">

         <property name="key" type = "long" column = "sol_uniqueKey" length="100"/>
         <property name="soLineNumber" type = "int" column = "sol_lineNumber" />

         <map name="flexAtt" table="SupOrdAttVals" cascade="all">
            <key column="solav_solID"/>
            <map-key column="soldav_attribute" type="java.lang.String"/>
            <element column="soldav_value" type="java.lang.String"/>
         </map>

         <map name="dates" table="SupOrdDates" cascade="all">
            <key column="soldate_solID"/>
            <map-key column="soldate_dateName" type="java.lang.String"/>
            <element column="soldate_dateValue" type="java.util.Date"/>
         </map>


         <!--<many-to-one name="supplyOrder" class="jobs.Job" column="sol_soID"  cascade="all" lazy = "true"/> -->
         <!--<many-to-one name="supplyOrder" class="jobs.order.SupplyOrder" column="sol_soID"  cascade="all" lazy = "true"/>-->
         
      </union-subclass>


   </class>
</hibernate-mapping>




Code between sessionFactory.openSession() and session.close():

...

config.addClass(jobs.Job.class);
config.addClass(jobs.JobLine.class);
...


Full stack trace of any exception that occurs:

...


Code:

able CusOrdAttVals (cusordav_jobID bigint not null, cusordav_value varchar(255), cusordav_attribute varchar(255) not null, primary key (cusordav_jobID, cusordav_attribute)) type=InnoDB
2954 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - create table CusOrdAttVals (cusordav_jobID bigint not null, cusordav_value varchar(255), cusordav_attribute varchar(255) not null, primary key (cusordav_jobID, cusordav_attribute)) type=InnoDB
create table CusOrdDates (cusord_jobID bigint not null, cusord_dateValue datetime, cusord_dateName varchar(255) not null, primary key (cusord_jobID, cusord_dateName)) type=InnoDB
3094 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - create table CusOrdDates (cusord_jobID bigint not null, cusord_dateValue datetime, cusord_dateName varchar(255) not null, primary key (cusord_jobID, cusord_dateName)) type=InnoDB
create table CustomerOrder (jobID bigint not null, job_version integer not null, cusord_uniqueKey bigint, cusord_jobName varchar(100), cusord_jobNameAlias varchar(100), cusord_orgID bigint, cusord_reqID bigint) type=InnoDB
3205 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - create table CustomerOrder (jobID bigint not null, job_version integer not null, cusord_uniqueKey bigint, cusord_jobName varchar(100), cusord_jobNameAlias varchar(100), cusord_orgID bigint, cusord_reqID bigint) type=InnoDB
create table CustomerOrderLine (jobLineID bigint not null, jobline_version integer not null, col_uniqueKey bigint, col_lineNumber integer, col_coID bigint) type=InnoDB
3315 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - create table CustomerOrderLine (jobLineID bigint not null, jobline_version integer not null, col_uniqueKey bigint, col_lineNumber integer, col_coID bigint) type=InnoDB
alter table ColAttVals add index FK46D616332FA3A95D (colav_colID), add constraint FK46D616332FA3A95D foreign key (colav_colID) references CustomerOrderLine (jobLineID)
3425 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table ColAttVals add index FK46D616332FA3A95D (colav_colID), add constraint FK46D616332FA3A95D foreign key (colav_colID) references CustomerOrderLine (jobLineID)
3545 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table ColAttVals add index FK46D616332FA3A95D (colav_colID), add constraint FK46D616332FA3A95D foreign key (colav_colID) references CustomerOrderLine (jobLineID)
3545 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table CusOrdAttVals add index FKB42DE93430D17C6 (cusordav_jobID), add constraint FKB42DE93430D17C6 foreign key (cusordav_jobID) references CustomerOrder (jobID)
3545 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table CusOrdAttVals add index FKB42DE93430D17C6 (cusordav_jobID), add constraint FKB42DE93430D17C6 foreign key (cusordav_jobID) references CustomerOrder (jobID)
3655 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table CusOrdAttVals add index FKB42DE93430D17C6 (cusordav_jobID), add constraint FKB42DE93430D17C6 foreign key (cusordav_jobID) references CustomerOrder (jobID)
3655 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table CusOrdDates add index FK83BD49656BA60751 (cusord_jobID), add constraint FK83BD49656BA60751 foreign key (cusord_jobID) references CustomerOrder (jobID)
3665 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table CusOrdDates add index FK83BD49656BA60751 (cusord_jobID), add constraint FK83BD49656BA60751 foreign key (cusord_jobID) references CustomerOrder (jobID)
3775 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table CusOrdDates add index FK83BD49656BA60751 (cusord_jobID), add constraint FK83BD49656BA60751 foreign key (cusord_jobID) references CustomerOrder (jobID)
3775 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table CustomerOrder add index FKAEF781F0A15F0EB2 (cusord_reqID), add constraint FKAEF781F0A15F0EB2 foreign key (cusord_reqID) references Request (jobID)
3775 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table CustomerOrder add index FKAEF781F0A15F0EB2 (cusord_reqID), add constraint FKAEF781F0A15F0EB2 foreign key (cusord_reqID) references Request (jobID)
3896 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table CustomerOrder add index FKAEF781F0A15F0EB2 (cusord_reqID), add constraint FKAEF781F0A15F0EB2 foreign key (cusord_reqID) references Request (jobID)
3896 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table CustomerOrder add index FKAEF781F08E80A (cusord_orgID), add constraint FKAEF781F08E80A foreign key (cusord_orgID) references Organisation (orgID)
3896 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table CustomerOrder add index FKAEF781F08E80A (cusord_orgID), add constraint FKAEF781F08E80A foreign key (cusord_orgID) references Organisation (orgID)
alter table CustomerOrderLine add index FK82A92E04A405139E (col_coID), add constraint FK82A92E04A405139E foreign key (col_coID) references CustomerOrder (jobID)
4226 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table CustomerOrderLine add index FK82A92E04A405139E (col_coID), add constraint FK82A92E04A405139E foreign key (col_coID) references CustomerOrder (jobID)
4476 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table CustomerOrderLine add index FK82A92E04A405139E (col_coID), add constraint FK82A92E04A405139E foreign key (col_coID) references CustomerOrder (jobID)
4486 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table ItemAttVals add index FK1B508D00FE473D78 (itemiav_elemID), add constraint FK1B508D00FE473D78 foreign key (itemiav_elemID) references ItemInstance (elemID)
4486 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table ItemAttVals add index FK1B508D00FE473D78 (itemiav_elemID), add constraint FK1B508D00FE473D78 foreign key (itemiav_elemID) references ItemInstance (elemID)
4597 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table ItemAttVals add index FK1B508D00FE473D78 (itemiav_elemID), add constraint FK1B508D00FE473D78 foreign key (itemiav_elemID) references ItemInstance (elemID)
4597 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table ItemDates add index FKF64DAF129B9EAAD4 (itemidates_elemID), add constraint FKF64DAF129B9EAAD4 foreign key (itemidates_elemID) references ItemInstance (elemID)
4597 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table ItemDates add index FKF64DAF129B9EAAD4 (itemidates_elemID), add constraint FKF64DAF129B9EAAD4 foreign key (itemidates_elemID) references ItemInstance (elemID)
4717 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table ItemDates add index FKF64DAF129B9EAAD4 (itemidates_elemID), add constraint FKF64DAF129B9EAAD4 foreign key (itemidates_elemID) references ItemInstance (elemID)
4717 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table ReqAttVals add index FKD3DD415587527824 (reqav_jobID), add constraint FKD3DD415587527824 foreign key (reqav_jobID) references Request (jobID)
4717 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table ReqAttVals add index FKD3DD415587527824 (reqav_jobID), add constraint FKD3DD415587527824 foreign key (reqav_jobID) references Request (jobID)
4837 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table ReqAttVals add index FKD3DD415587527824 (reqav_jobID), add constraint FKD3DD415587527824 foreign key (reqav_jobID) references Request (jobID)
4837 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table RequestDates add index FK55F4B9563CB372F (req_jobID), add constraint FK55F4B9563CB372F foreign key (req_jobID) references Request (jobID)
4837 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table RequestDates add index FK55F4B9563CB372F (req_jobID), add constraint FK55F4B9563CB372F foreign key (req_jobID) references Request (jobID)
4957 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table RequestDates add index FK55F4B9563CB372F (req_jobID), add constraint FK55F4B9563CB372F foreign key (req_jobID) references Request (jobID)
4957 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table RequestDates add index FK55F4B95652B3EE16 (coldate_colID), add constraint FK55F4B95652B3EE16 foreign key (coldate_colID) references CustomerOrderLine (jobLineID)
4957 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table RequestDates add index FK55F4B95652B3EE16 (coldate_colID), add constraint FK55F4B95652B3EE16 foreign key (coldate_colID) references CustomerOrderLine (jobLineID)
5047 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table RequestDates add index FK55F4B95652B3EE16 (coldate_colID), add constraint FK55F4B95652B3EE16 foreign key (coldate_colID) references CustomerOrderLine (jobLineID)
5047 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table SupOrdAttVals add index FK34C52E60A63E6528 (supordav_jobID), add constraint FK34C52E60A63E6528 foreign key (supordav_jobID) references SupplyOrder (jobID)
5047 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table SupOrdAttVals add index FK34C52E60A63E6528 (supordav_jobID), add constraint FK34C52E60A63E6528 foreign key (supordav_jobID) references SupplyOrder (jobID)
5167 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table SupOrdAttVals add index FK34C52E60A63E6528 (supordav_jobID), add constraint FK34C52E60A63E6528 foreign key (supordav_jobID) references SupplyOrder (jobID)
5167 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table SupOrdAttVals add index FK34C52E607F8F918C (solav_solID), add constraint FK34C52E607F8F918C foreign key (solav_solID) references SupplyOrderLine (jobLineID)
5167 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table SupOrdAttVals add index FK34C52E607F8F918C (solav_solID), add constraint FK34C52E607F8F918C foreign key (solav_solID) references SupplyOrderLine (jobLineID)
5288 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table SupOrdAttVals add index FK34C52E607F8F918C (solav_solID), add constraint FK34C52E607F8F918C foreign key (solav_solID) references SupplyOrderLine (jobLineID)
5288 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table SupOrdDates add index FK153B2872664DAD73 (supord_jobID), add constraint FK153B2872664DAD73 foreign key (supord_jobID) references SupplyOrder (jobID)
5298 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table SupOrdDates add index FK153B2872664DAD73 (supord_jobID), add constraint FK153B2872664DAD73 foreign key (supord_jobID) references SupplyOrder (jobID)
5408 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table SupOrdDates add index FK153B2872664DAD73 (supord_jobID), add constraint FK153B2872664DAD73 foreign key (supord_jobID) references SupplyOrder (jobID)
5408 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table SupOrdDates add index FK153B28723C851245 (soldate_solID), add constraint FK153B28723C851245 foreign key (soldate_solID) references SupplyOrderLine (jobLineID)
5408 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table SupOrdDates add index FK153B28723C851245 (soldate_solID), add constraint FK153B28723C851245 foreign key (soldate_solID) references SupplyOrderLine (jobLineID)
5528 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table SupOrdDates add index FK153B28723C851245 (soldate_solID), add constraint FK153B28723C851245 foreign key (soldate_solID) references SupplyOrderLine (jobLineID)
5528 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table SupplyOrder add index FK6054D37FF578ECBF (supord_cusOrdID), add constraint FK6054D37FF578ECBF foreign key (supord_cusOrdID) references CustomerOrder (jobID)
5528 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table SupplyOrder add index FK6054D37FF578ECBF (supord_cusOrdID), add constraint FK6054D37FF578ECBF foreign key (supord_cusOrdID) references CustomerOrder (jobID)
5648 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table SupplyOrder add index FK6054D37FF578ECBF (supord_cusOrdID), add constraint FK6054D37FF578ECBF foreign key (supord_cusOrdID) references CustomerOrder (jobID)
5648 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table VNAttVals add index FKB08B61DB637591EA (vnwav_elemID), add constraint FKB08B61DB637591EA foreign key (vnwav_elemID) references VirtualNetwork (elemID)
5648 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table VNAttVals add index FKB08B61DB637591EA (vnwav_elemID), add constraint FKB08B61DB637591EA foreign key (vnwav_elemID) references VirtualNetwork (elemID)
5768 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table VNAttVals add index FKB08B61DB637591EA (vnwav_elemID), add constraint FKB08B61DB637591EA foreign key (vnwav_elemID) references VirtualNetwork (elemID)
5768 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
alter table VNDates add index FK4E5DFEAD4F908011 (vnwdate_elemID), add constraint FK4E5DFEAD4F908011 foreign key (vnwdate_elemID) references VirtualNetwork (elemID)
5768 [main] DEBUG org.hibernate.tool.hbm2ddl.SchemaUpdate  - alter table VNDates add index FK4E5DFEAD4F908011 (vnwdate_elemID), add constraint FK4E5DFEAD4F908011 foreign key (vnwdate_elemID) references VirtualNetwork (elemID)
5888 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Unsuccessful: alter table VNDates add index FK4E5DFEAD4F908011 (vnwdate_elemID), add constraint FK4E5DFEAD4F908011 foreign key (vnwdate_elemID) references VirtualNetwork (elemID)
5888 [main] ERROR org.hibernate.tool.hbm2ddl.SchemaUpdate  - Can't create table '.\test\#sql-71c_47.frm' (errno: 150)
5888 [main] INFO org.hibernate.tool.hbm2ddl.SchemaUpdate  - schema update complete
5888 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider  - cleaning up connection pool: jdbc:mysql://localhost:3306/test
5888 [main] DEBUG org.hibernate.cfg.Configuration  - Preparing to build session factory with filters : {}
5888 [main] INFO org.hibernate.cfg.Configuration  - processing extends queue
5888 [main] INFO org.hibernate.cfg.Configuration  - processing collection mappings
5888 [main] INFO org.hibernate.cfg.Configuration  - processing association property references
5888 [main] INFO org.hibernate.cfg.Configuration  - processing foreign key constraints
5888 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Site
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Site
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.ContractAmendment
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.order.CustomerOrderLine
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Contract
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Customer
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Contract
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.order.CustomerOrder
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.order.CustomerOrder
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.request.Request
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Organisation
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.order.CustomerOrder
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: portfolio.Product
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.ItemInstance
5898 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.ItemInstance
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.CPE
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Site
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Organisation
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Organisation
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: portfolio.ProductType
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: portfolio.ProductCategory
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: portfolio.Product
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: portfolio.ProductCategory
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: portfolio.Product
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: portfolio.Item
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.request.Request
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Organisation
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.request.Request
5908 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.order.CustomerOrderLine
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Organisation
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Site
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.order.SupplyOrder
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.order.SupplyOrderLine
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.order.SupplyOrder
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.order.SupplyOrderLine
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: customer.Organisation
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: jobs.order.CustomerOrder
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.VirtualNetwork
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.VirtualNetwork
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.CPE
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.Bearer
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.CPE
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.NetworkService
5918 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.Bearer
5928 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.NetworkService
5928 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.Bearer
5928 [main] DEBUG org.hibernate.cfg.Configuration  - resolving reference to class: inventory.NetworkService
6349 [main] INFO org.hibernate.dialect.Dialect  - Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
6359 [main] DEBUG org.hibernate.exception.SQLExceptionConverterFactory  - Using dialect defined converter
6359 [main] INFO org.hibernate.cfg.SettingsFactory  - Maximum outer join fetch depth: 2
6359 [main] INFO org.hibernate.cfg.SettingsFactory  - Default batch fetch size: 1
6359 [main] INFO org.hibernate.cfg.SettingsFactory  - Generate SQL with comments: disabled
6359 [main] INFO org.hibernate.cfg.SettingsFactory  - Order SQL updates by primary key: disabled
6359 [main] INFO org.hibernate.cfg.SettingsFactory  - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
6369 [main] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory  - Using ASTQueryTranslatorFactory
6369 [main] INFO org.hibernate.cfg.SettingsFactory  - Query language substitutions: {}
6369 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider  - Using Hibernate built-in connection pool (not for production use!)
6369 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider  - Hibernate connection pool size: 4
6369 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider  - autocommit mode: false
6369 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider  - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/test
6369 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider  - connection properties: {user=woodmawa, password=}
6369 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider  - total checked-out connections: 0
6369 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider  - opening new JDBC connection
6389 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider  - created connection to: jdbc:mysql://localhost:3306/test, Isolation Level: 4
6389 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider  - returning connection to pool, pool size: 1
6389 [main] INFO org.hibernate.cfg.SettingsFactory  - JDBC batch size: 15
6389 [main] INFO org.hibernate.cfg.SettingsFactory  - JDBC batch updates for versioned data: disabled
6399 [main] INFO org.hibernate.cfg.SettingsFactory  - Scrollable result sets: enabled
6399 [main] DEBUG org.hibernate.cfg.SettingsFactory  - Wrap result sets: disabled
6399 [main] INFO org.hibernate.cfg.SettingsFactory  - JDBC3 getGeneratedKeys(): enabled
6409 [main] INFO org.hibernate.transaction.TransactionFactoryFactory  - Using default transaction strategy (direct JDBC transactions)
6409 [main] INFO org.hibernate.transaction.TransactionManagerLookupFactory  - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
6409 [main] INFO org.hibernate.cfg.SettingsFactory  - Automatic flush during beforeCompletion(): disabled
6409 [main] INFO org.hibernate.cfg.SettingsFactory  - Automatic session close at end of transaction: disabled
6409 [main] INFO org.hibernate.cfg.SettingsFactory  - Cache provider: org.hibernate.cache.HashtableCacheProvider
6419 [main] INFO org.hibernate.cfg.SettingsFactory  - Second-level cache: enabled
6419 [main] INFO org.hibernate.cfg.SettingsFactory  - Optimize cache for minimal puts: disabled
6419 [main] INFO org.hibernate.cfg.SettingsFactory  - Structured second-level cache entries: enabled
6419 [main] INFO org.hibernate.cfg.SettingsFactory  - Query cache: disabled
6419 [main] INFO org.hibernate.cfg.SettingsFactory  - Echoing all SQL to stdout
6419 [main] INFO org.hibernate.cfg.SettingsFactory  - Statistics: disabled
6419 [main] INFO org.hibernate.cfg.SettingsFactory  - Deleted entity synthetic identifier rollback: disabled
6429 [main] INFO org.hibernate.cfg.SettingsFactory  - Default entity-mode: pojo
6589 [main] INFO org.hibernate.impl.SessionFactoryImpl  - building session factory
6589 [main] DEBUG org.hibernate.impl.SessionFactoryImpl  - Session factory constructed with filter configurations : {}
6589 [main] DEBUG org.hibernate.impl.SessionFactoryImpl  - instantiating session factory with properties: {hibernate.connection.password=, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, sun.boot.library.path=D:\jdk1.5.0\jre\bin, java.vm.version=1.5.0-b64, hibernate.connection.username=woodmawa, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=GB, sun.os.patch.level=Service Pack 4, java.vm.specification.name=Java Virtual Machine Specification, user.dir=D:\eclipse\workspace\hibernate\bin, java.runtime.version=1.5.0-b64, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=D:\jdk1.5.0\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=D:\DOCUME~1\woodmawa\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 2000, sun.jnu.encoding=Cp1252, java.library.path=D:\jdk1.5.0\bin;.;C:\WINNT\system32;C:\WINNT;D:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Common Files\Adaptec Shared\System;D:\Program Files\Rational\common;D:\Program Files\MySQL\MySQL Server 4.1\bin, java.specification.name=Java Platform API Specification, java.class.version=49.0, hibernate.connection.pool_size=4, sun.management.compiler=HotSpot Client Compiler, os.version=5.0, user.home=D:\Documents and Settings\woodmawa, user.timezone=, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.5, hibernate.connection.driver_class=com.mysql.jdbc.Driver, show_sql=true, user.name=woodmawa, java.class.path=D:\eclipse\workspace\hibernate\bin;D:\hibernate-3.0\hibernate3.jar;D:\hibernate-3.0\lib\xml-apis.jar;D:\hibernate-3.0\lib\ant-antlr-1.6.2.jar;D:\hibernate-3.0\lib\ant-junit-1.6.2.jar;D:\hibernate-3.0\lib\ant-launcher-1.6.2.jar;D:\hibernate-3.0\lib\antlr-2.7.4.jar;D:\hibernate-3.0\lib\ant-swing-1.6.2.jar;D:\hibernate-3.0\lib\c3p0-0.8.5.jar;D:\hibernate-3.0\lib\cglib-full-2.0.2.jar;D:\hibernate-3.0\lib\cleanimports.jar;D:\hibernate-3.0\lib\commons-collections-2.1.1.jar;D:\hibernate-3.0\lib\commons-logging-1.0.4.jar;D:\hibernate-3.0\lib\concurrent-1.3.2.jar;D:\hibernate-3.0\lib\connector.jar;D:\hibernate-3.0\lib\dom4j-1.5.2.jar;D:\hibernate-3.0\lib\ehcache-1.1.jar;D:\hibernate-3.0\lib\jaas.jar;D:\hibernate-3.0\lib\jacc-1_0-fr.jar;D:\hibernate-3.0\lib\jaxen-1.1-beta-4.jar;D:\hibernate-3.0\lib\jboss-cache.jar;D:\hibernate-3.0\lib\jboss-common.jar;D:\hibernate-3.0\lib\jboss-jmx.jar;D:\hibernate-3.0\lib\jboss-remoting.jar;D:\hibernate-3.0\lib\jboss-system.jar;D:\hibernate-3.0\lib\jdbc2_0-stdext.jar;D:\hibernate-3.0\lib\jgroups-2.2.7.jar;D:\hibernate-3.0\lib\jta.jar;D:\hibernate-3.0\lib\junit-3.8.1.jar;D:\hibernate-3.0\lib\log4j-1.2.9.jar;D:\hibernate-3.0\lib\oscache-2.1.jar;D:\hibernate-3.0\lib\proxool-0.8.3.jar;D:\hibernate-3.0\lib\swarmcache-1.0rc2.jar;D:\hibernate-3.0\lib\versioncheck.jar;D:\hibernate-3.0\lib\xerces-2.6.2.jar;D:\hibernate-3.0\lib\ant-1.6.2.jar;D:\downloads\Xdoclet\xdoclet-bin-1.2.2.zip, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=D:\jdk1.5.0\jre, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect, hibernate.connection.url=jdbc:mysql://localhost:3306/test, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, sharing, java.version=1.5.0, java.ext.dirs=D:\jdk1.5.0\jre\lib\ext, sun.boot.class.path=D:\jdk1.5.0\jre\lib\rt.jar;D:\jdk1.5.0\jre\lib\i18n.jar;D:\jdk1.5.0\jre\lib\sunrsasign.jar;D:\jdk1.5.0\jre\lib\jsse.jar;D:\jdk1.5.0\jre\lib\jce.jar;D:\jdk1.5.0\jre\lib\charsets.jar;D:\jdk1.5.0\jre\classes, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, sun.desktop=windows, sun.cpu.isalist=}
6840 [main] DEBUG org.hibernate.util.ReflectHelper  - reflection optimizer disabled for: jobs.order.SupplyOrder, IllegalAccessError: tried to access method jobs.Job.getJobName()Ljava/lang/String; from class jobs.order.SupplyOrder$$BulkBeanByCGLIB$$819c649b
6870 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  - Static SQL for entity: jobs.order.SupplyOrder
6870 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  -  Version select: select job_version from SupplyOrder where jobID =?
6870 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  -  Snapshot select: select supplyorde_.jobID, supplyorde_.job_version as job2_30_, supplyorde_.supord_uniqueKey as supord1_37_, supplyorde_.supord_jobName as supord2_37_, supplyorde_.supord_jobNameAlias as supord3_37_, supplyorde_.supord_orgID as supord4_37_ from SupplyOrder supplyorde_ where supplyorde_.jobID=?
6870 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  -  Insert 0: insert into SupplyOrder (job_version, supord_uniqueKey, supord_jobName, supord_jobNameAlias, supord_orgID, jobID) values (?, ?, ?, ?, ?, ?)
6870 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  -  Update 0: update SupplyOrder set job_version=?, supord_uniqueKey=?, supord_jobName=?, supord_jobNameAlias=?, supord_orgID=? where jobID=? and job_version=?
6870 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  -  Delete 0: delete from SupplyOrder where jobID=? and job_version=?
7030 [Finalizer] INFO org.hibernate.connection.DriverManagerConnectionProvider  - cleaning up connection pool: jdbc:mysql://localhost:3306/test
7040 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  - Static SQL for entity: customer.ContractAmendment
7040 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  -  Version select: select coa_version from ContractAmendment where coaID =?
7040 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  -  Snapshot select: select contractam_.coaID, contractam_.coa_version as coa2_15_, contractam_.coa_uniqueKey as coa3_15_, contractam_.coa_name as coa4_15_, contractam_.coa_description as coa5_15_, contractam_.coa_conID as coa6_15_ from ContractAmendment contractam_ where contractam_.coaID=?
7040 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  -  Insert 0: insert into ContractAmendment (coa_version, coa_uniqueKey, coa_name, coa_description, coa_conID, coaID) values (?, ?, ?, ?, ?, ?)
7040 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  -  Update 0: update ContractAmendment set coa_version=?, coa_uniqueKey=?, coa_name=?, coa_description=?, coa_conID=? where coaID=? and coa_version=?
7040 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister  -  Delete 0: delete from ContractAmendment where coaID=? and coa_version=?
Exception in thread "main" java.lang.RuntimeException: Could not determine type for column col_coID of type org.hibernate.type.ManyToOneType: org.hibernate.MappingException
   at persistence.HibernatePersistenceManager.init(HibernatePersistenceManager.java:106)
   at hibernatedemo.DemoDB.main(DemoDB.java:42)
Caused by: org.hibernate.MappingException: Could not determine type for column col_coID of type org.hibernate.type.ManyToOneType: org.hibernate.MappingException
   at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:131)
   at org.hibernate.persister.entity.UnionSubclassEntityPersister.generateSubquery(UnionSubclassEntityPersister.java:320)
   at org.hibernate.persister.entity.UnionSubclassEntityPersister.<init>(UnionSubclassEntityPersister.java:135)
   at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:61)
   at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:199)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)
   at persistence.HibernatePersistenceManager.init(HibernatePersistenceManager.java:102)
   ... 1 more
Caused by: org.hibernate.MappingException: Unknown entity: jobs.order.CustomerOrder
   at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:489)
   at org.hibernate.impl.SessionFactoryImpl.getIdentifierType(SessionFactoryImpl.java:563)
   at org.hibernate.type.EntityType.getIdentifierType(EntityType.java:216)
   at org.hibernate.type.EntityType.getIdentifierOrUniqueKeyType(EntityType.java:226)
   at org.hibernate.type.ManyToOneType.sqlTypes(ManyToOneType.java:29)
   at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:124)
   ... 7 more




Name and version of the database you are using:
mysql 4.1

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 31, 2005 3:46 am 
Newbie

Joined: Wed Mar 02, 2005 8:31 am
Posts: 1
This bug is just fixed: http://opensource.atlassian.com/projects/hibernate/browse/HHH-279[/url]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.