Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Can't not instance class...

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic