- This topic has 6 replies, 2 voices, and was last updated 19 years, 9 months ago by Riyad Kalla.
-
AuthorPosts
-
drowellMember– System Setup ——————————-
Operating System and version: Linux Redhat Fedora Core
Eclipse version: 3.0.1
Eclipse build id: 20040961125
Fresh Eclipse install (y/n): y
If not, was it upgraded to its current version using the update manager?
Other installed external plugins:
Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*:
MyEclipse version: 3.8.3
Eclipse JDK version: 1.4.2
Application Server JDK version: 1.4.2
Are there any exceptions in the Eclipse log file? NoneDavid Rowell
drowell@settimogroup.com
davidallanrowell@hotmail.comOur development team is creating EJB Data Objects, also referred to as Value Objects. When XDoclet generates the java file, the code contains a Collection variable that gives off an error that the Collection type cannot be found. Essentially the XDoclet generated file is not bringing in “import java.util.Collection”
How do we get XDoclet to generate Value Object java files correctly when the generated java file contains Collections.
Also note that our other code, that we create, is able to use Collections successfully, so we have our j2se setup correctly.
Any help is greatly appreciated.
David Rowell
drowell@settimogroup.com
davidallanrowell@hotmail.com
Riyad KallaMemberDavid,
I remember something like this with another gentleman, and it was an issue of him setting the value type to “java.util.List” instead of, for example, “List” in his XDoclet tags before running XDoclet… is this a similar case with you? Can you provide a code snippet for us to see and pour over?
drowellMemberI have provided a code snippet below:
Visitor.java file
/**
* @ejb.value-object
* aggregate=”com.hobsons.nafsa.model.entity.interfaces.CountryValue”
* aggregate-name=”IntrestedCountry”
* members=”com.hobsons.nafsa.model.entity.interfaces.CountryLocal”
* members-name=”IntrestedCountry”
* relation=”external”
* type=”Collection”
*
* @ejb.relation
* name=”Visitor-Interest-Country”
* role-name=”visitor-has-country”
* @jboss.relation related-pk-field=”visitorId”
* fk-column=”countryId”
* @jboss.relation-table table-name=”VisitorInterestCountry”
* create-table=”true”
* delete-table=”true”
*/
public abstract java.util.Collection getInterestCountry();
VistorValue.java file
private java.lang.String orgName;
private boolean orgNameHasBeenSet = false;
private java.lang.String country2Id;
private boolean country2IdHasBeenSet = false;
private Collection IntrestedCountrys = new java.util.ArrayList();
The type Collection is not defined
drowellMemberBased upon your response, are you saying that the last line in the code snippet should be:
private Collection InterestedCountrys = new ArrayList(); instead of
private Collection IntrestedCountrys = new java.util.ArrayList();
?
Riyad KallaMemberActually no, this was the same problem he had, he had to change this:
/** * @ejb.value-object * aggregate="com.hobsons.nafsa.model.entity.interfaces.CountryValue" * aggregate-name="IntrestedCountry" * members="com.hobsons.nafsa.model.entity.interfaces.CountryLocal" * members-name="IntrestedCountry" * relation="external" * type="Collection" <snip>
To this:
/** * @ejb.value-object * aggregate="com.hobsons.nafsa.model.entity.interfaces.CountryValue" * aggregate-name="IntrestedCountry" * members="com.hobsons.nafsa.model.entity.interfaces.CountryLocal" * members-name="IntrestedCountry" * relation="external" * type="java.util.Collection" <snip>
(note the last line)
You should be able to import the classes in the Java code and just use their short names, but for the tags and generated XML descriptor you need to fully qualify the class name, which is why you need to change that value in your XD tag.
drowellMemberThat was the problem. Thank you very much. Your support is superior.
Riyad KallaMemberThat was the problem. Thank you very much. Your support is superior.
Glad it worked, and thank you.
-
AuthorPosts