There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Using Oracle Sequence in Hibernate
    via by mridul das,
  • I have two tables, QWB_EXTRCT_VW_CLMN and QWB_FLDR_CLMN. QWB_EXTRCT_VW_CLMN has a composite primary key with columns EXTRCT_VW_NUM and FLDR_CLMN_NUM, FLDR_CLMN_NUM being a foreign key to the (single) primary key of the QWB_FLDR_CLMN table. Middlegen generates the following mapping for QwbFldrClmn: <composite-id name="comp_id" class="testQwb.hibernate.persistent.QwbExtrctVwClmnPK"> <meta attribute="field-description"> generator-class="assigned" </meta> <!-- uni-directional one-to-one association to QwbFldrClmn --> <key-many-to-one name="qwbFldrClmn" class="testQwb.hibernate.persistent.QwbFldrClmn" > <column name="FLDR_CLMN_NUM" /> </key-many-to-one> <!-- bi-directional many-to-one association to QwbExtrctVw --> <key-many-to-one name="qwbExtrctVw" class="testQwb.hibernate.persistent.QwbExtrctVw" > <column name="EXTRCT_VW_NUM" /> </key-many-to-one> </composite-id> However when run the following exception is thrown: net.sf.hibernate.MappingException: Foreign key (QWB_EXTRCT_VW_CLMN [FLDR_CLMN_NUM])) must have same number of columns as the reference primary key (QWB_FLDR_CLMN [FLDR_NUM,FLDR_CLMN_NUM]) at net.sf.hibernate.mapping.ForeignKey.setReferencedTable( at net.sf.hibernate.cfg.Configuration.secondPassCompile( at net.sf.hibernate.cfg.Configuration.buildSessionFactory( at org.ifmc.qw.hibernate.HibernateSession.init( at testQwb.hibernate.TestHibernate3.main( Note that this xml works with the 2.1 beta 6, but not with RC1. Is Middlegen not putting something in? BTW in general I am having a heck of a time migrating from 2.1 Beta 6 to RC1 using Middlegen created XML files. Seems to me to be a good idea to do more testing with Middlegen and Hibernate to make sure the generated files work. Or else modify Hibernate or Middlegen so they would cooperate better. Also please note that this is NOT the same problem as with HB-512, I am already using the patched code but yet I now have this new error. Thanks, Daniel
    via by Daniel Rosenbaum,
  • I've generated two hbm with Middlegen with a simple one-to-one relation: A first object with a composite 2 field key, and 10 other plain properties, and another object with a normal long key and two properties. The declaration on the relation in the first object is: <many-to-one name="commento" class="Commento" unique="false" insert="false" update="false" > <column name="MLCOM" /> </many-to-one> In the other object: <one-to-one name="marelo" class="Marelo" outer-join="auto" property-ref="commento" /> When I ask any page of the application, I get an error during Hibernate session's initialization. Here's the stack trace: 16:20:54,849 ERROR HibernateSessionFactory:35 - error configuring net.sf.hibernate.MappingException: bug in initComponentPropertyPaths at net.sf.hibernate.persister.AbstractPropertyMapping.initComponentPropertyPaths( at net.sf.hibernate.persister.AbstractPropertyMapping.initPropertyPaths( at net.sf.hibernate.persister.AbstractPropertyMapping.initPropertyPaths( at net.sf.hibernate.persister.AbstractEntityPersister.initPropertyPaths( at net.sf.hibernate.persister.EntityPersister.postInstantiate( at net.sf.hibernate.impl.SessionFactoryImpl.<init>( at net.sf.hibernate.cfg.Configuration.buildSessionFactory( at cinetica.hibernate.web.component.HibernateSessionFactory.init( [snip] Caused by: java.lang.ArrayIndexOutOfBoundsException: 1 at net.sf.hibernate.util.ArrayHelper.slice( at net.sf.hibernate.persister.AbstractPropertyMapping.initComponentPropertyPaths( ... 52 more
    via by Marco Papini,
  • I have three tables (each has a composite key). I get following message exception during mapping processing. net.sf.hibernate.MappingException: Repeated column in mapping for collection: test.User.points column: HO_ID at net.sf.hibernate.collection.AbstractCollectionPersister.checkColumnDuplication( at net.sf.hibernate.collection.AbstractCollectionPersister.<init>( at net.sf.hibernate.collection.BasicCollectionPersister.<init>( at net.sf.hibernate.persister.PersisterFactory.createCollectionPersister( at net.sf.hibernate.impl.SessionFactoryImpl.<init>( at net.sf.hibernate.cfg.Configuration.buildSessionFactory( SCHEMA DEFINITION ----------------- Table: M_USER - HO_ID (PK) - KA_ID (PK) - NAME Table: M_YEAR - HO_ID (PK) - YEAR_ID (PK) - Q_DATE Table: POINT - HO_ID (PK,FK) - KA_ID (PK,FK) - YEAR_ID (PK,FK) - POINT MAPPING FILE ------------ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" ""> <hibernate-mapping > <class name="test.User" table="M_USER" > <composite-id name="comp_id" class="test.UserPK" > <key-property name="hoId" type="java.lang.String" column="HO_ID" /> <key-property name="kaId" type="java.lang.String" column="KA_ID" /> </composite-id> <property name="name" type="java.lang.String" column="NAME" length="20" /> <map name="points" table="POINT" lazy="false" sort="unsorted" cascade="none" > <key> <column name="HO_ID"/> <column name="KA_ID"/> </key> <index-many-to-many class="test.Year" > <column name="HO_ID"/> <column name="YEAR_ID"/> </index-many-to-many> <composite-element class="test.Point"> <property name="point" type="java.lang.Integer" column="POINT" length="3" /> </composite-element> </map> </class> </hibernate-mapping>
    via by Yoshitaka Takamura,
    • net.sf.hibernate.MappingException: could not instantiate id generator at at net.sf.hibernate.mapping.SimpleValue.createIdentifierGenerator( at net.sf.hibernate.persister.AbstractEntityPersister.<init>( at net.sf.hibernate.persister.EntityPersister.<init>( at net.sf.hibernate.persister.PersisterFactory.createClassPersister( at net.sf.hibernate.impl.SessionFactoryImpl.<init>( at net.sf.hibernate.cfg.Configuration.buildSessionFactory( at Main.main( Caused by: net.sf.hibernate.MappingException: Dialect does not support sequences at net.sf.hibernate.dialect.Dialect.getSequenceNextValString( at at ... 7 more
    No Bugmate found.