Hi all,
I have two classes, Bloqueio that extends Periodo. I am using jsp pages to insert data in my database. I configure hibernate to use joined-subclass, but I have a message: net.sf.hibernate.JDBCException: could not insert: [com.gfmi.delivery.wms.agendamento.Periodo#1]
My hbm file:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping >
<class name="com.gfmi.delivery.wms.agendamento.Periodo" table="DELIV_WMS_PERIODO" >
<id name="id" type="int" column="PK_ID_PERIODO">
<generator class="increment" />
</id>
<property name="horaInicio" column="DH_HORA_INICIO" type="date" not-null="false" />
<property name="horaEncerramento" column="DH_HORA_ENCERRAMENTO" type="date" not-null="false" />
<joined-subclass name="com.gfmi.delivery.wms.agendamento.Bloqueio" table="DELIV_WMS_BLOQUEIO">
<key column="FK_ID_PERIODO" />
<property name="Data" column="DH_DATA" type="date" not-null="false" />
<property name="tipo" column="N_TIPO" type="int" not-null="false" />
<property name="diaSemana" column="N_DIA_SEMANA" type="int" not-null="false" />
</joined-subclass>
</class>
</hibernate-mapping>
I don't know if this is the right way to do.
Thanks all