Thank you for your reply,
I mapped my bean as follows :
Code:
<?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 package="previtc.model.task">
<class name="PcTask" table="PC_TASK" dynamic-update="true" dynamic-insert="true">
<id name="taskId" column="TASKID" type="string">
<generator class="sequence">
<param name="sequence">PC_TASK_ID_SEQ</param>
</generator>
</id>
<property name="taskNumber" generated="insert" type="java.lang.Integer" insert="false" update="false">
<column name="TASKNUMBER" not-null="true" unique="true" />
</property>
<property name="acquiredBy" column="ACQUIREDBY" type="string" />
<property name="approvers" column="APPROVERS" type="string" />
[... other fields ...]
</class>
</hibernate-mapping>
and on my schema I have the field TASKNUMBER as nullable=false. But when I try to insert in my database an object of the type
PCTASK , I got complained that
ORA-01400: cannot insert NULL into ("PREVITC"."PC_TASK"."TASKNUMBER") .
This is obviously because when I instantiate an object PcTask, I do not assign any value to his TASKNUMBER field, because I want
it to be generated at the moment of the Insert statement.
Do you have any suggestions ? Thanks a lot in advance , I really appreciate your help cause I'm noob and stuck