[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: Problems with JPA/Hibernate persist

jharby1 do-not-reply at jboss.com
Tue Nov 25 17:05:54 EST 2008


P.S. I'm using Intellij's ORM generator to create the entity - here is the generated code for that:


  | package com.csatp.model;
  | 
  | import javax.persistence.*;
  | import java.sql.Timestamp;
  | 
  | @Entity
  | @Table(catalog = "WeekOld", schema = "dbo", name = "RECORDLOCK")
  | public class RecordlockEntity {
  |     private int recordlockseqno;
  | 
  |     @Id
  |     @GeneratedValue(strategy=GenerationType.AUTO)
  |     @Column(name = "recordlockseqno", nullable = false, length = 10)
  |     public int getRecordlockseqno() {
  |         return recordlockseqno;
  |     }
  | 
  |     public void setRecordlockseqno(int recordlockseqno) {
  |         this.recordlockseqno = recordlockseqno;
  |     }
  | 
  |     private String username;
  | 
  |     @Basic
  |     @Column(name = "username", nullable = false, length = 10)
  |     public String getUsername() {
  |         return username;
  |     }
  | 
  |     public void setUsername(String username) {
  |         this.username = username;
  |     }
  | 
  |     private Timestamp lockdate;
  | 
  |     @Basic
  |     @Column(name = "lockdate", nullable = false, length = 23, precision = 3)
  |     public Timestamp getLockdate() {
  |         return lockdate;
  |     }
  | 
  |     public void setLockdate(Timestamp lockdate) {
  |         this.lockdate = lockdate;
  |     }
  | 
  |     private Timestamp expirationdate;
  | 
  |     @Basic
  |     @Column(name = "expirationdate", length = 23, precision = 3)
  |     public Timestamp getExpirationdate() {
  |         return expirationdate;
  |     }
  | 
  |     public void setExpirationdate(Timestamp expirationdate) {
  |         this.expirationdate = expirationdate;
  |     }
  | 
  |     private String recordkey;
  | 
  |     @Basic
  |     @Column(name = "recordkey", nullable = false, length = 30)
  |     public String getRecordkey() {
  |         return recordkey;
  |     }
  | 
  |     public void setRecordkey(String recordkey) {
  |         this.recordkey = recordkey;
  |     }
  | 
  |     private String recordtype;
  | 
  |     @Basic
  |     @Column(name = "recordtype", nullable = false, length = 10)
  |     public String getRecordtype() {
  |         return recordtype;
  |     }
  | 
  |     public void setRecordtype(String recordtype) {
  |         this.recordtype = recordtype;
  |     }
  | 
  |     public boolean equals(Object o) {
  |         if (this == o) return true;
  |         if (o == null || getClass() != o.getClass()) return false;
  | 
  |         RecordlockEntity that = (RecordlockEntity) o;
  | 
  |         if (recordlockseqno != that.recordlockseqno) return false;
  |         if (expirationdate != null ? !expirationdate.equals(that.expirationdate) : that.expirationdate != null)
  |             return false;
  |         if (lockdate != null ? !lockdate.equals(that.lockdate) : that.lockdate != null) return false;
  |         if (recordkey != null ? !recordkey.equals(that.recordkey) : that.recordkey != null) return false;
  |         if (recordtype != null ? !recordtype.equals(that.recordtype) : that.recordtype != null) return false;
  |         if (username != null ? !username.equals(that.username) : that.username != null) return false;
  | 
  |         return true;
  |     }
  | 
  |     public int hashCode() {
  |         int result;
  |         result = recordlockseqno;
  |         result = 31 * result + (username != null ? username.hashCode() : 0);
  |         result = 31 * result + (lockdate != null ? lockdate.hashCode() : 0);
  |         result = 31 * result + (expirationdate != null ? expirationdate.hashCode() : 0);
  |         result = 31 * result + (recordkey != null ? recordkey.hashCode() : 0);
  |         result = 31 * result + (recordtype != null ? recordtype.hashCode() : 0);
  |         return result;
  |     }
  | }
  | 
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192288#4192288

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192288



More information about the jboss-user mailing list