I am getting an ArrayIndexOutOfBoundsException if and only if I have a component with more than 10 properties and a
one-to-many set. If I remove the set, or reduce the number of properties in the component, there is no exception.
Hibernate version:
H3rc1
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<!--
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
-->
<class name="com.opi.core.domain.Employer" table="EMPLOYER"
schema="AAPX_D" >
<id name="id" type="java.lang.Long">
<column name="OID" scale="18" precision="0" not-null="true" unique="true" sql-type="NUMBER" />
<generator class="sequence" >
<param name="sequence">EMPLOYER_PK_SQ</param>
</generator>
</id>
<version name="version" column="VERSION" type="java.lang.Long" />
<property name="auditInfo" type="com.opi.core.domain.AuditInfoType">
<column name="DATE_MODIFIED"/>
<column name="DATE_CREATED"/>
<column name="MODIFIED_BY"/>
<column name="CREATED_BY"/>
</property>
<property name="EmployerId" type="java.lang.String" >
<column name="EMPLOYER_ID" scale="30" precision="0" not-null="true" sql-type="VARCHAR2" />
</property>
<property name="EmployerName" type="java.lang.String" >
<column name="EMPLOYER_NAME" scale="30" precision="0" not-null="true" sql-type="VARCHAR2" />
</property>
<component name="address" class="com.opi.core.domain.Address">
<property name="CountryCode" type="java.lang.String" >
<column name="COUNTRY_CODE" scale="30" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="Addr1" type="java.lang.String">
<column name="ADDR1" scale="4000" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="Addr2" type="java.lang.String">
<column name="ADDR2" scale="4000" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="Addr3" type="java.lang.String">
<column name="ADDR3" scale="4000" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="Addr4" type="java.lang.String">
<column name="ADDR4" scale="4000" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="Addr5" type="java.lang.String">
<column name="ADDR5" scale="4000" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="Addr6" type="java.lang.String">
<column name="ADDR6" scale="4000" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="Latitude" type="java.lang.String">
<column name="LATITUDE" scale="30" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="Longitude" type="java.lang.String">
<column name="LONGITUDE" scale="30" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="City" type="java.lang.String">
<column name="CITY" scale="4000" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="State" type="java.lang.String">
<column name="STATE" scale="4000" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="PostalCode" type="java.lang.String">
<column name="POSTAL_CODE" scale="4000" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="FipsCode" type="java.lang.String">
<column name="FIPS_CODE" scale="4000" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
</component>
<property name="Status" type="java.lang.String" >
<column name="STATUS" scale="30" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="StatusReason" type="java.lang.String" >
<column name="STATUS_REASON" scale="4000" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="FederalId" type="java.lang.String" >
<column name="FEDERAL_ID" scale="9" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<property name="StateId" type="java.lang.String" >
<column name="STATE_ID" scale="20" precision="0" not-null="false" sql-type="VARCHAR2" />
</property>
<set name="SetOfEmployment" lazy="true" inverse="true" >
<key>
<column name="EMPLOYER_OID" scale="18" precision="0" not-null="false" />
</key>
<one-to-many class="com.opi.core.domain.Employment"/>
</set>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:Code:
java.lang.ArrayIndexOutOfBoundsException: 10
at org.hibernate.event.def.DirtyCollectionSearchVisitor.includeProperty(DirtyCollectionSearchVisitor.java:63)
at org.hibernate.event.def.AbstractVisitor.processValues(AbstractVisitor.java:42)
at org.hibernate.event.def.AbstractVisitor.processComponent(AbstractVisitor.java:62)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:87)
at org.hibernate.event.def.AbstractVisitor.processValues(AbstractVisitor.java:43)
at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:300)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:111)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:669)
at com.opi.core.dao.BaseDAOTest.tearDown(BaseDAOTest.java:50)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:474)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194)
Name and version of the database you are using:
Oracle 9i