i have extra property inside entity class like below, where the variable "balanceAmount" is not part of the field in database table. when i call save statement in hibernate, i get error msg
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:187)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.sql.SQLException: ORA-00904:
"POSSESSION_"."BALANCEAMOUNT": invalid identifier
can i put custom propetry like "
balanceAmount" inside entity class, even thought such field not exist in database table?
is there any
annotation i can put so that hibernate will
ignore this property?
Code:
@Entity
@Table(name = "POS_SESSION")
@NamedQueries({@NamedQuery(name = "PosSession.findByPssId", query = "SELECT p FROM PosSession p WHERE p.pssId = :pssId"), @NamedQuery(name = "PosSession.findByPssDate", query = "SELECT p FROM PosSession p WHERE p.pssDate = :pssDate"), @NamedQuery(name = "PosSession.findByPssReceiptLastrunno", query = "SELECT p FROM PosSession p WHERE p.pssReceiptLastrunno = :pssReceiptLastrunno"), @NamedQuery(name = "PosSession.findByPssAmtopening", query = "SELECT p FROM PosSession p WHERE p.pssAmtopening = :pssAmtopening"), @NamedQuery(name = "PosSession.findByPssAmtpickup", query = "SELECT p FROM PosSession p WHERE p.pssAmtpickup = :pssAmtpickup"), @NamedQuery(name = "PosSession.findByPssAmtclosing", query = "SELECT p FROM PosSession p WHERE p.pssAmtclosing = :pssAmtclosing"), @NamedQuery(name = "PosSession.findByPssAmtcashsales", query = "SELECT p FROM PosSession p WHERE p.pssAmtcashsales = :pssAmtcashsales"), @NamedQuery(name = "PosSession.findByPssStatus", query = "SELECT p FROM PosSession p WHERE p.pssStatus = :pssStatus"), @NamedQuery(name = "PosSession.findByPssCreated", query = "SELECT p FROM PosSession p WHERE p.pssCreated = :pssCreated"), @NamedQuery(name = "PosSession.findByPssCreator", query = "SELECT p FROM PosSession p WHERE p.pssCreator = :pssCreator"), @NamedQuery(name = "PosSession.findByPssLastmodified", query = "SELECT p FROM PosSession p WHERE p.pssLastmodified = :pssLastmodified"), @NamedQuery(name = "PosSession.findByPssLastmodifier", query = "SELECT p FROM PosSession p WHERE p.pssLastmodifier = :pssLastmodifier")})
public class PosSession implements Serializable {
@Transient
private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
private static final long serialVersionUID = 1L;
@Id
@Column(name = "PSS_ID", nullable = false)
private BigDecimal pssId;
@Column(name = "PSS_DATE")
@Temporal(TemporalType.TIMESTAMP)
private Date pssDate;
@Column(name = "PSS_RECEIPT_LASTRUNNO")
private BigInteger pssReceiptLastrunno;
@Column(name = "PSS_AMTOPENING")
private BigDecimal pssAmtopening;
@Column(name = "PSS_AMTPICKUP")
private BigDecimal pssAmtpickup;
@Column(name = "PSS_AMTCLOSING")
private BigDecimal pssAmtclosing;
@Column(name = "PSS_AMTCASHSALES")
private BigDecimal pssAmtcashsales;
@Column(name = "PSS_STATUS")
private BigInteger pssStatus;
@Column(name = "PSS_CREATED")
@Temporal(TemporalType.TIMESTAMP)
private Date pssCreated;
@Column(name = "PSS_CREATOR")
private String pssCreator;
@Column(name = "PSS_LASTMODIFIED")
@Temporal(TemporalType.TIMESTAMP)
private Date pssLastmodified;
@Column(name = "PSS_LASTMODIFIER")
private String pssLastmodifier;
//custom
private BigDecimal balanceAmount;