Hi, I have a little doubt.
Suppose I have a Question class and I do this:
******************
Question q = new Question();
q.setText("question1");
getSession.save(q);
*******************
that should persist the question in the db.
then in another moment(session) I repeat the same thing.
Then in my DB i get:
id text
1 question1
2 question1
BUT I want to get:
id text
1 question1
Please tell me I m doing something wrong. Thanks!
This is my mapping:
Code:
<hibernate-mapping>
<class name="Question" table="QUESTION">
<id name="id" column="ID">
<generator class="native"/>
</id>
<property name="text" type="string"></property>
</class>
<hibernate-mapping>