hibernate: [hibernatedoclet] 17:13:40,553 INFO start:47 - Running <hibernate/> BUILD SUCCESSFUL Total time: 1 second
Really don't know the problem and so I will post my *.java files with @hibernate tags and first of all the part of my ant build file which should start everything:
ant's build.xml hibernate part:
<target name="hibernate" depends="prepare"
description="Generates Hibernate class descriptor files."> <taskdef name="hibernatedoclet"
classname="xdoclet.modules.hibernate.HibernateDocletTask"> <classpath>
<fileset dir="./libs/">
<include name="*.jar"/>
</fileset>
</classpath> </taskdef>
<!-- Execute the hibernatedoclet task -->
<hibernatedoclet
destdir="./src/core/mappings/"
excludedtags="@version,@author,@todo"
force="true"
verbose="true"
mergedir="${dist}">
<fileset dir=".">
<include name="./src/core/*.java"/>
</fileset>
<hibernate version="2.0"/>
</hibernatedoclet> </target>
and here comes all of my java classes:
OurNode.java:
package core;
import java.util.Date;
import javax.swing.tree.DefaultMutableTreeNode;
/**
* @hibernate.class
*/
public class OurNode extends DefaultMutableTreeNode {
private String name = null;
private String author = null;
private Date dateOfCreation = null; //TODO use sql.Date instead?
private long ID;//TODO id and dateOfCreation from DB
/**
* Constructor
*/
public OurNode() {
this.name = "new OurNode";
this.author = "none";
this.dateOfCreation = new Date();
}
/**
* Constructor
* @param name of the node
*/
public OurNode(String name) {
this.name = name;
this.author = "none";
this.dateOfCreation = new Date();
}
/**
* Constructor
* @param name of the node
*/
public OurNode(String name, long id) {
this.name = name;
this.author = "none";
this.dateOfCreation = new Date();
this.ID = id;
}
/**
* Constructor
* @param name of the node
*/
public OurNode(String name, long id, Date date) {
this.name = name;
this.author = "none";
this.ID = id;
this.dateOfCreation = date;
}
/**
* Set the author of this node
*/
public void setAuthor(String auth) {
this.author = auth;
}
/**
* @hibernate.property
* @return The author of this node
*/
public String getAuthor() {
return this.author;
}
/**
* @hibernate.property
* @return Returns the name.
*/
public String getName() {
return name;
}
/**
* @param name The name to set.
*/
public void setName(String name) {
this.name = name;
}
/**
* @return name as String
*/
public String toString() {
return name;
}
/**
* @hibernate.property
* @return Returns the id
*/
public long getID() {
return ID;
}
/**
* @hibernate.property
* @return Returns the dateOfCreation.
*/
public Date getDateOfCreation() {
return dateOfCreation;
}
}
Person.java:
package core;
/** * @hibernate.class */ public abstract class Person { protected String name; protected String password;
/** * @hibernate.id generator-class="assigned" * @return Returns the name. */ public String getName() { return name; } /** * @param name The name to set. */ public void setName(String name) { this.name = name; } /** * @hibernate.property * @return Returns the password. */ public String getPassword() { return password; } /** * @param password The password to set. */ public void setPassword(String password) { this.password = password; } }
Professor.java:
package core;
/** * @hibernate.subclass */ public class Professor extends Person { public Professor(String name, String pass) { super.name = name; super.password = pass; } }
QuestionNode.java:
package core;
import java.util.*; import javax.swing.ImageIcon;
/**
* @hibernate.subclass
*/
public class QuestionNode extends OurNode {
private String questionBody = null;
private ArrayList answers = new ArrayList();
private ImageIcon image = null;
/**
* Constructor
* @param name for node
*/
public QuestionNode(String name, long id) {
super(name, id);
}
/**
*
* @param name sets field questionName
* @param qust sets field questionBody
*/
public QuestionNode(String name, String qust) {
super(name);
this.questionBody = qust;
} // end constructor
/**
*
* @param name sets field questionName
* @param qust sets field questionBody
*/
public QuestionNode(String name, String qust, long id, Date dat) {
super(name, id, dat);
this.questionBody = qust;
} // end constructor/**
/**
*
* @return questionBody
*/
public String getQuestionBody() {
return questionBody;
}
/**
*
* @param index indicates which answer has to bei chosen from ArraList answers
* @return answer at index
*/
public Answer getAnswer(int index) {
return (Answer)answers.get(index);
}
/**
* @return indicates which answers are true and which are false
*/
public boolean[] getCorrectAnswer() {
boolean[] correctAnswer = {
((Answer)answers.get(0)).isCorrect(),
((Answer)answers.get(1)).isCorrect(),
((Answer)answers.get(2)).isCorrect(),
((Answer)answers.get(3)).isCorrect()};
return correctAnswer;
}
/**
*
* @return ImageIcon
*/
public ImageIcon getImage() {
return image;
}
/**
*
* @param body set questionBody
*/
public void setQuestionBody(String body) {
questionBody = body;
}
/**
* add a new answer to the ArrayList answers
* @param answer text of the answer
* @param c if answer is true or false
*/
public void addAnswer(String answer, boolean c, String annotation, long ID) {
answers.add(new Answer(answer, c, annotation, ID));
}
/**
* sets answer at index
* @param index which answer is going to be changed
* @param text text of the answer
* @param c if answer is true or false
*/
public void setAnswer(int index, String text, boolean c)
{
((Answer)answers.get(index)).setAnswer(text);
((Answer)answers.get(index)).setCorrect(c);
}//end setAnswer
/**
* sets annotation at index
* @param index index of annotation, actually answer
* @param text text to set annotation to
*/
public void setAnnotation(int index, String text) {
((Answer)answers.get(index)).setAnnotation(text);
}
/**
* add or change the image to the question
* @param ImageIcon to set
*/
public void setImage(ImageIcon ic) {
image = ic;
}
}
Test.java:
package core;
import java.util.ArrayList;
/**
* @hibernate.class
*/
public class Test {
private ArrayList categoryList = new ArrayList();
private String name = null;
private long time=200000;
private int clef[]; /* The clef, i.e. the marks and their resp. points */
// TODO HIBERNATE set a default unique name since the name attribute is the id for hibernate mapping
public Test() {
super();
}
/**
* Constructor
*/
public Test(String name) {
this.name = name;
this.clef = new int[4];
for (int i = 0; i < clef.length; i++)
clef[i] = 50; // default initialize
}
public void addCategory(DirectoryNode q) {
categoryList.add(q);
}
public void removeCategory(DirectoryNode q) {
categoryList.remove(q);
}
/**
* @hibernate.list
* @return Returns the categoryList.
*/
public ArrayList getCategoryList() {
return categoryList;
}
/**
* @param categoryList The categoryList to set.
*/
public void setCategoryList(ArrayList categoryList) {
this.categoryList = categoryList;
}
/**
* @return Returns name of test
*/
public String toString() {
return name;
}
/**
* @hibernate.id generator-class="assigned"
* @return Returns the name.
*/
public String getName() {
return name;
}
/**
* @param name The name to set.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* @param time The time to set
*/
public void setTime(long time) {
this.time = time;
}
/**
* @hibernate.property column="time" type="string"
* @return The time this test is going to last
*/
public long getTime() {
return this.time;
}
/**
* Set the clef of the test
* @param clefs an int array with the clefs
*/
public void setClef(int [] clefs) {
this.clef = clefs;
} // end setClef
/**
* @hibernate.array
* Get the clef from the test
* @return an int array with the clefs
*/
public int [] getClef() {
return this.clef;
} // end getClef
}
Student.java:
package core;
/** * @hibernate.subclass */ public class Student extends Person {
public Student(String name, String pass) { super.name = name; super.password = pass; } }
Answer.java:
package core;
/**
* @hibernate.class
*/
public class Answer {
String answer = null;
boolean isCorrect = false;
String annotation = null;
/**
* Constructor of Class Answer
* @param a sets the field answer to a
* @param c sets isCorrect true if the anserwer is true
*/
public Answer(String a, boolean c, String annotation, long id)
{
this.answer=a;
this.isCorrect=c;
this.annotation = annotation;
}//end constructor
/** * @hibernate.property * @return Returns the answer. */ public String getAnswer() { return answer; } /** * @param answer The answer to set. */ public void setAnswer(String answer) { this.answer = answer; } /** * @return Returns the isCorrect. */ public boolean isCorrect() { return isCorrect; } /** * @param isCorrect The isCorrect to set. */ public void setCorrect(boolean isCorrect) { this.isCorrect = isCorrect; } /** * @return Returns the annotation. */ public String getAnnotation() { return annotation; } /** * @param annotation The annotation to set. */ public void setAnnotation(String annotation) { this.annotation = annotation; } }//end class
Administrator.java:
package core;
/** * @hibernate.subclass */ public class Administrator extends Person { public Administrator(String name, String pass) { super.name = name; super.password = pass; } }
Really hope somebody could help me otherwise I would be lost.
best regards, tezem
------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click _______________________________________________ xdoclet-user mailing list xdoclet-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-user