Asuming the following entity:
{code:java} @Entity(name = "CentsAndDollarsAccount") public class CentsAndDollarsAccount {
@Id @GeneratedValue private Long id;
private Long cents;
@Formula( "cast(a.cents as double) / 100" ) private Double dollars;
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public Long getCents() { return cents; }
public void setCents(Long cents) { this.cents = cents; }
public Double getDollars() { return dollars; } } {code}
When trying to load the entity, the following SQL query is generated:
|
|