Hi
I get the exception below when my <subclass> element has a single <component> element like in my mapping file below.
If i add a <property> element along with the <component>, i don't get any exceptions. The problem is that i don't want to add a column to my table for a dummy property. When I declare a formula in my property
<property name="dummy" formula="...."/> i get the same error.
Hibernate version: 3.0.5
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="folder">
<subclass name="Sheet" extends="SheetWithResults">
<join table="SHEET" fetch="select">
<key column="IDTSHEET"/>
<component name="subscriptions" class="CollectionHolder">
<bag name="items" lazy="true" cascade="all-delete-orphan">
<key column="SHEETID"/>
<one-to-many class="Subscription"/>
</bag>
</component>
</join>
</subclass>
</hibernate-mapping>
Full stack trace of any exception that occurs:Code:
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -2
at java.lang.String.substring(String.java:1444)
at java.lang.String.substring(String.java:1411)
at org.hibernate.persister.entity.AbstractEntityPersister.renderSelect(AbstractEntityPersister.java:2595)
at org.hibernate.persister.entity.SingleTableEntityPersister.generateSequentialSelect(SingleTableEntityPersister.java:624)
at org.hibernate.persister.entity.SingleTableEntityPersister.postInstantiate(SingleTableEntityPersister.java:673)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:274)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)