-->
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: Can not instance class...
PostPosted: Thu Apr 08, 2010 10:21 am 
Newbie

Joined: Wed Apr 07, 2010 10:46 am
Posts: 4
Good Morning

My situation is:'

I got this orm object

@hibernate.joined-subclass
* lazy="false"
* table="DIVISION"
* dynamic-update="true"
* dynamic-insert="true"
* @hibernate.joined-subclass-key
* column="PARTY_ROLE_ID"
*
public class Division extends OrganizationUnit implements IDivisionRole {


If you see this a child class, parents
of this class are:

/**
* @hibernate.joined-subclass
* lazy="false"
* table="ORGANIZATION_UNIT"
* dynamic-update="true"
* dynamic-insert="true"
* @hibernate.joined-subclass-key
* column="PARTY_ROLE_ID"
*
*
*
*/

public abstract class OrganizationUnit extends AbstractOrganizationRole {

-------------------------------------------------------------------------------------------
and
-------------------------------------------------------------------------------------------

/**
* @hibernate.joined-subclass
* lazy="false"
* table="ORGANIZATION_ROLE"
* dynamic-update="true"
* dynamic-insert="true"
* @hibernate.joined-subclass-key column="PARTY_ROLE_ID"
*
*
*/

public abstract class AbstractOrganizationRole extends AbstractPartyRole implements IOrganizationRole {


-------------------------------------------------------------------------------------------
and finally the parent
-------------------------------------------------------------------------------------------


/**
* @hibernate.class
* lazy="false"
* table="PARTY_ROLE"
* dynamic-update="true"
* dynamic-insert="true"
*
*/


public abstract class AbstractPartyRole implements IPartyRole,IPersistenceObject, Serializable {


So, the issue related to "can't not instance class INSURANCE_SUPPORT_STAFF" is


INSURANCE_SUPPORT_STAFF class is not a parent of DIVISION but some times, not all the times, only sometimes I got this error when I invoke DIVISION it wants to get also INSURANCE_SUPPORT_STAFF that it's not part of this parent herarqy.



This is the HBM



<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping
>
<class
name="com.uig.unica.core.components.party.domain.orm.AbstractPartyRole"
table="PARTY_ROLE"
lazy="false"
dynamic-update="true"
dynamic-insert="true"
>

<id
name="ID"
column="PARTY_ROLE_ID"
type="java.lang.Long"
unsaved-value="null"
>
<generator class="sequence">
<param name="sequence">PARTY_SEQ</param>
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-AbstractPartyRole.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>

<many-to-one
name="party"
class="com.uig.unica.core.components.party.domain.orm.Party"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="PARTY_ID"
not-null="true"
/>

<many-to-one
name="roleType"
class="com.uig.unica.core.components.party.domain.orm.RoleType"
cascade="none"
outer-join="auto"
update="true"
insert="true"
column="ROLE_TYPE_ID"
not-null="true"
/>

<set
name="partyRelationshipFrom"
lazy="true"
inverse="true"
cascade="all"
sort="unsorted"
>

<key
column="PARTY_ROLE_ID_FROM"
>
</key>

<one-to-many
class="com.uig.unica.core.components.party.domain.orm.PartyRelationship"
/>

</set>

<set
name="partyRelationshipTo"
lazy="true"
inverse="true"
cascade="all"
sort="unsorted"
>

<key
column="PARTY_ROLE_ID_TO"
>
</key>

<one-to-many
class="com.uig.unica.core.components.party.domain.orm.PartyRelationship"
/>

</set>

<property
name="validFrom"
type="java.util.Date"
update="true"
insert="true"
column="VALID_FROM"
length="7"
not-null="true"
/>

<property
name="validThru"
type="java.util.Date"
update="true"
insert="true"
column="VALID_THRU"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-AbstractPartyRole.xml
containing the additional properties and place it in your merge dir.
-->

<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.AbstractOrganizationRole"
table="ORGANIZATION_ROLE"
dynamic-update="true"
dynamic-insert="true"
lazy="false"
>
<key
column="PARTY_ROLE_ID"
/>

<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.InsuranceAgency"
table="INSURANCE_AGENCY"
dynamic-update="true"
dynamic-insert="true"
lazy="false"
>
<key
column="PARTY_ROLE_ID"
/>
<property
name="code"
type="java.lang.String"
update="true"
insert="true"
column="CODE"
length="28"
not-null="true"
/>

<property
name="imageRoute"
type="java.lang.String"
update="true"
insert="true"
column="IMAGE_ROUTE"
/>

<property
name="signatureRoute"
type="java.lang.String"
update="true"
insert="true"
column="SIGNATURE_ROUTE"
/>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.Bank"
table="BANK"
dynamic-update="true"
dynamic-insert="true"
lazy="false"
>
<key
column="PARTY_ROLE_ID"
/>
<property
name="code"
type="java.lang.String"
update="true"
insert="true"
column="CODE"
length="28"
not-null="true"
/>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.InsuranceProvider"
table="INSURANCE_PROVIDER"
dynamic-update="true"
dynamic-insert="true"
lazy="false"
>
<key
column="PARTY_ROLE_ID"
/>
<property
name="code"
type="java.lang.String"
update="true"
insert="true"
column="CODE"
length="28"
not-null="true"
/>

<property
name="imageRoute"
type="java.lang.String"
update="true"
insert="true"
column="image_route"
/>

<set
name="derramas"
lazy="true"
inverse="true"
cascade="all"
sort="unsorted"
>

<key
column="PARTY_ROLE_ID"
>
</key>

<one-to-many
class="com.uig.unica.core.components.party.domain.orm.Derrama"
/>

</set>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.OrganizationUnit"
table="ORGANIZATION_UNIT"
dynamic-update="true"
dynamic-insert="true"
lazy="false"
>
<key
column="PARTY_ROLE_ID"
/>

<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.Division"
table="DIVISION"
dynamic-update="true"
dynamic-insert="true"
lazy="false"
>
<key
column="PARTY_ROLE_ID"
/>

</joined-subclass>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.Dealer"
table="DEALER"
dynamic-update="true"
dynamic-insert="true"
lazy="false"
>
<key
column="PARTY_ROLE_ID"
/>
<property
name="code"
type="java.lang.String"
update="true"
insert="true"
column="CODE"
length="28"
not-null="true"
/>

</joined-subclass>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.OrganizationRole"
table="ORGANIZATION_ROLE"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.AbstractPersonRole"
table="PERSON_ROLE"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>

<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.InsuranceSupportStaff"
table="INSURANCE_SUPPORT_STAFF"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>

<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.Supervisor"
table="SUPERVISER"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.Underwriter"
table="UNDERWRITER"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>
<property
name="code"
type="java.lang.String"
update="true"
insert="true"
column="CODE"
length="28"
not-null="true"
/>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.WFTaskApprover"
table="WF_TASK_APPROVER"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.Producer"
table="PRODUCER"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>
<property
name="code"
type="java.lang.String"
update="true"
insert="true"
column="CODE"
length="28"
not-null="true"
/>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.WFTaskDelegate"
table="WF_TASK_DELEGATE"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>

</joined-subclass>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.InsuranceAgent"
table="INSURANCE_AGENT"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>
<property
name="code"
type="java.lang.String"
update="true"
insert="true"
column="CODE"
length="28"
not-null="true"
/>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.Prospect"
table="PROSPECT"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.Employee"
table="EMPLOYEE"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>

</joined-subclass>
<joined-subclass
name="com.uig.unica.core.components.party.domain.orm.Driver"
table="DRIVER"
dynamic-update="true"
dynamic-insert="true"
>
<key
column="PARTY_ROLE_ID"
/>
<property
name="licNumber"
type="java.lang.String"
update="true"
insert="true"
column="LICNUMBER"
length="12"
/>

<property
name="expDate"
type="java.util.Date"
update="true"
insert="true"
column="EXP_DATE"
length="12"
/>

<property
name="effDate"
type="java.util.Date"
update="true"
insert="true"
column="EFF_DATE"
length="12"
/>

</joined-subclass>

</joined-subclass>

</class>

</hibernate-mapping>


Thanks for help


Top
 Profile  
 
 Post subject: Re: Can not instance class...
PostPosted: Thu Apr 08, 2010 10:26 am 
Regular
Regular

Joined: Wed Mar 10, 2010 4:48 am
Posts: 106
You should put your code and the mapping in code tags: [ code][ /code] (without spaces).


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.