Hibernate version: 3.2
Name and version of the database you are using: HSQLDB 1.8.0.7
External Libraries: GWT, Hibernate4GWT, HiberGeneration
I have a table
Utenti automatically generated by HiberGeneration (
http://objectgeneration.com/eclipse/).
Utenti.hmb.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated by HiberObjects. DO NOT EDIT! -->
<hibernate-mapping>
<class name='it.pep.gwtesami.domain.Utenti' table='tb_utenti'>
<id name='id' type='long' column='ID'>
<generator class='native' />
</id>
<property column='nome' unique='true' type='string' name='nome'>
</property>
<property column='pword' type='string' name='pword'>
</property>
<many-to-one foreign-key='fk_utenti_domini_id' class='it.pep.gwtesami.domain.Domini' not-null='true' cascade='save-update' name='domini'>
<column name='domini_id'/>
</many-to-one>
</class>
</hibernate-mapping>
source file Utenti.javaCode:
package it.pep.gwtesami.domain;
import net.sf.hibernate4gwt.pojo.gwt.LazyGwtPojo;
import com.google.gwt.user.client.rpc.IsSerializable;
/**
* @generated
*/
public class Utenti extends LazyGwtPojo{
/**
* @generated
*/
private String nome;
/**
* @generated
*/
private String pword;
/**
* @generated
*/
private Domini domini;
/**
* @generated
*/
private Long id;
/**
* @generated
*/
public Utenti() {
}
/**
* @generated
*/
public String toString() {
return "Utenti" + " nome=" + nome + " pword=" + pword + " id=" + id;
}
/**
* @generated
*/
public String getNome() {
return this.nome;
}
/**
* @generated
*/
public void setNome(String nome) {
this.nome = nome;
}
/**
* @generated
*/
public String getPword() {
return this.pword;
}
/**
* @generated
*/
public void setPword(String pword) {
this.pword = pword;
}
/**
* @generated
*/
public Domini getDomini() {
return this.domini;
}
/**
* @generated
*/
public void setDomini(Domini domini) {
this.domini = domini;
}
/**
* @generated
*/
public Long getId() {
return this.id;
}
/**
* @generated
*/
public void setId(Long id) {
this.id = id;
}
}
when I use the statement
Code:
System.out.println("id: "+anUtente.getId());
I got null id. The same for every table and relation of database, the id is ever null.
Can you help me?
Thanks.