-->
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.  [ 4 posts ] 
Author Message
 Post subject: Problem with simple Collection of Strings
PostPosted: Fri Dec 22, 2006 1:20 am 
Beginner
Beginner

Joined: Sat Dec 16, 2006 1:52 pm
Posts: 40
I am attempting to implement the following.

class ChildClass extends SuperClass {
Set set; //contains strings
}

The super class had an id with generator native.
The child class is using joined-subclass and has
<key column="OBJECT_ID"/>

I am holding the set of strings in the child class like so

<set name="boundValues" table="BOUNDVALUES">
<key column="PropertyID" on-delete="cascade"/>
<element column="BoundValue" type="string" unique="true"/>
</set>


It all looks simple enough. Hibernate is complaining

org.hibernate.MappingException: Could not determine type for: com.rgdsft.hibernate.core.models.DBPropertyType, for columns: [org.hibernate.mapping.Column(PROPERTY_ID)]

DBPropertyType is the child class.


Any idea why this would be? I can post the whole files if you like. Only a few of them and they are pretty simple. This is the tricky situation I had hoped Hibernate would solve for me. JDO does not support this yet...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 22, 2006 8:16 am 
Beginner
Beginner

Joined: Tue Aug 29, 2006 8:13 pm
Posts: 32
Location: Spain (GU)
First foremost,

You should declare the type of Set (Set is an interface). Something like this:

Code:
Set<String> paragraphs;


Secondly, the set-tag would be like this:

Code:
<set name="xxxxx" inverse="true">
      <key column="PropertyID"/>
      <one-to-many class="YOUR_CLASS"/>
</set>



Best regards.

_________________
Please don't forget the credit system.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 22, 2006 8:20 am 
Beginner
Beginner

Joined: Sat Dec 16, 2006 1:52 pm
Posts: 40
First, I am not using generics so I can not declare the Set type.

Second, this is a collection of Strings, not a collection of a persistable type. So YOUR_CLASS would be String? But there can not be an inverse relationship here either because the String class does not contain a reference to the class holding it in its collection.

Can you explain better your choices?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 22, 2006 9:46 am 
Beginner
Beginner

Joined: Tue Aug 29, 2006 8:13 pm
Posts: 32
Location: Spain (GU)
Hello,

Code:
<set name="xxxxx">
      <key column="PropertyID"/>
      <one-to-many class="java.lang.String"/>
</set>


If it doesn't run, I advice to see reference documentation for mapping an inheritance relation.

Sorry for my english.

Regards.

_________________
Please don't forget the credit system.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.