I have following classes:
deal class:
Code:
@EmbeddableSuperclass
class Deal {
private String source;
@Column(name = "SOURCE")
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
}
order class:
Code:
@Entity
@Table(name="ORDERS")
public class Order {
private Deal deal;
@Embedded
@AttributeOverrides(value = {
@AttributeOverride(name = "source", column = @Column(name="NULLCOLUMN", insertable=false,updatable=false))})
public Deal getDeal() {
return deal;
}
public void setDeal(Deal deal) {
this.deal = deal;
}
}
As you can see I don't want to see Source property from Deal class in Order class (don't want to get in from database or save it back). How can we make it transient? For now we do annoying @AttributeOverride on unused NULLCOLUMN with updatable and insertable flags set to false..