-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: extra property inside entity class
PostPosted: Wed Jul 16, 2008 11:53 am 
Beginner
Beginner

Joined: Wed Oct 03, 2007 9:46 pm
Posts: 37
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;




Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.