-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate Association Problem
PostPosted: Tue Oct 30, 2007 12:21 pm 
Newbie

Joined: Thu Aug 23, 2007 8:55 pm
Posts: 3
Hi guys,

I'm creating a web service application that uses hibernate. I created 2 java class namely Tbl_Member and Tbl_Dependents. Both of the classes comes with their own respective mapping file (hbm.xml). Now my problem is when i try to build my project (using netbeans 5.5), my compiler throws an error. Here's the error message when i tried to build my project in netbeans:

Collection types are not supported in literal mode - Type: "java.util.Set"
at com.sun.xml.rpc.processor.modeler.rmi.LiteralTypeModeler.modelTypeLiteral(LiteralTypeModeler.java:67)
at com.sun.xml.rpc.processor.modeler.rmi.LiteralTypeModeler.modelTypeLiteral(LiteralTypeModeler.java:52)
at com.sun.xml.rpc.processor.modeler.rmi.LiteralTypeModeler.fillInStructure(LiteralTypeModeler.java:623)
at com.sun.xml.rpc.processor.modeler.rmi.LiteralTypeModeler.modelTypeLiteral(LiteralTypeModeler.java:349)
at com.sun.xml.rpc.processor.modeler.rmi.LiteralTypeModeler.modelTypeLiteral(LiteralTypeModeler.java:52)
at com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.processDocumentLiteralMethod(RmiModeler.java:1202)
at com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.processMethod(RmiModeler.java:826)
at com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.processInterface(RmiModeler.java:748)
at com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.modelPort(RmiModeler.java:683)
at com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.buildLiteralModel(RmiModeler.java:603)
at com.sun.xml.rpc.processor.modeler.rmi.RmiModeler.buildModel(RmiModeler.java:457)
at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:88)
at com.sun.xml.rpc.processor.Processor.runModeler(Processor.java:63)
at com.sun.xml.rpc.tools.wscompile.CompileTool.run(CompileTool.java:714)
at com.sun.xml.rpc.util.ToolBase.run(ToolBase.java:43)
at com.sun.xml.rpc.tools.wscompile.Main.main(Main.java:22)
error: Collection types are not supported in literal mode - Type: "java.util.Set"

\JAVA\PHWebService\nbproject\build-impl.xml:294: wscompile failed


Here's the definition of my class file (Tbl_Members) and its mapping file:


public class Tbl_Members {
private String memid_no;
private String batch_id;

//other private variables

private java.util.Set dependents = new java.util.HashSet();

/** Creates a new instance of Tbl_Members */
public Tbl_Members() {
}

public String getMemid_no() {
return memid_no;
}

public void setMemid_no(String memid_no) {
this.memid_no = memid_no;
}
//other setter getter methods

public java.util.Set getDependents() {
return dependents;
}

public void setDependents(java.util.Set dependents) {
this.dependents = dependents;
}
}

<?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>
<class name="entity.Tbl_Members" table="TBL_MEMBERS">
<id name="memid_no" column="memid_no">
</id>

<!-- other properties -->

<set name="dependents" cascade="all">
<key column="memid_no"/>
<one-to-many class="entity.Tbl_Dependents" />
</set>

</class>

</hibernate-mapping>

Here's the definition of my Tbl_Dependent class and its mapping file:

public class Tbl_Dependents implements Serializable {
private String memid_no;
private String seq_no;
//other private variables

public Tbl_Dependents() {

}

public String getMemid_no() {
return memid_no;
}

public void setMemid_no(String memid_no) {
this.memid_no = memid_no;
}

public String getSeq_no() {
return seq_no;
}

public void setSeq_no(String seq_no) {
this.seq_no = seq_no;
}

//other setter getter methods
}


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

<hibernate-mapping>
<class name="entity.Tbl_Dependents" table="TBL_DEPENDENTS">
<composite-id>
<key-property column="memid_no" name="memid_no" />
</composite-id>
<property name="seq_no" column="seq_no" />
<!-- other properties -->
</class>
</hibernate-mapping>


Now, I was thinking if the error that i received (when i compile my project) is caused by my application being a web service project in my netbeans. I have heard that there are some limitations in datatypes when deploying a web service. If so, is the java.util.Set is one of the limitations in a web service application? What are the possible workaround if that's the case?
Or is there is something that I just missed out?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.