Hello, please, see the code below:
@Entity(name="PrecoDiaAjustado", entityType=EntityType.BMP, access=AccessType.PROPERTY, version=3)
@SqlResultSetMapping(name="MAP_PrecoDiaAjustado_SP", entities={@EntityResult(name="br.com.valoriza.addin.acoes.persistencia.PrecoDiaAjustado")})
@NamedQuery(name="PrecoDiaAjustado_SP", queryString="{ ? = call a_ADDIN_GetDadoAjustado (?, ?, ?, ?) }", resultType="MAP_PrecoDiaAjustado_SP")
public class PrecoDiaAjustado implements Serializable {
private double valor;
@Column(name="Valor", primaryKey=true)
public double getValor() {
return valor;
}
public void setValor(double valor) {
this.valor = valor;
}
}
When I try to map this class with the AnnotationConfiguration class, I get:
Caused by: java.lang.NullPointerException
at org.hibernate.mapping.PersistentClass.createPrimaryKey(PersistentClass.java:283)
Why? My stored procedure returns only one resultset with the "valor" field, there isn't a primary key. I'm using Hibernate 3.0.5 and Annotations beta2.
[]s
Ary Junior
|