-->
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.  [ 4 posts ] 
Author Message
 Post subject: reverse engineering VIEWS and tables w/o a primary key
PostPosted: Thu Jul 27, 2006 4:31 pm 
Newbie

Joined: Thu Feb 19, 2004 10:25 pm
Posts: 16
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.x

Mapping documents:
N/A

Code between sessionFactory.openSession() and
N/A
session.close():


Full stack trace of any exception that occurs:
N/A

Name and version of the database you are using:
Oracle 9i2

The generated SQL (show_sql=true):
N/A

Debug level Hibernate log excerpt:
N/A

When reverse engineering VIEWS and tables w/o a primary key using Hibernate Tools 3.2.0.beta6a the result I'm getting is that all columns become part of one large compound primary key like this:


Code:
package org.ridoc.orm;
// Generated Jul 27, 2006 3:27:00 PM by Hibernate Tools 3.2.0.beta6a

/**
* NamesInmateView generated by hbm2java
*/
public class NamesInmateView  implements java.io.Serializable {

    // Fields   

     private NamesInmateViewId id;

     // Constructors

    /** default constructor */
    public NamesInmateView() {
    }

    /** full constructor */
    public NamesInmateView(NamesInmateViewId id) {
       this.id = id;
    }
   
   
    // Property accessors
    public NamesInmateViewId getId() {
        return this.id;
    }
   
    public void setId(NamesInmateViewId id) {
        this.id = id;
    }
}


Code:
package org.ridoc.orm;
// Generated Jul 27, 2006 3:27:00 PM by Hibernate Tools 3.2.0.beta6a


import java.util.Date;

/**
* NamesInmateViewId generated by hbm2java
*/
public class NamesInmateViewId  implements java.io.Serializable {

    // Fields   

     private String NLastName;
     private String NFirstName;
     private String NMinit;
     private int NInmateId;
     private Date NDob;
     private String NSsno;
     private String NAka;
     private String NSuffix;
     private String NStatus;
     private Integer NIncarcerationNumber;
     private String ISecurityId;
     private String IArea;
     private String ICellId;
     private Date IDob;
     private String IRace;
     private String ISex;
     private String IStatus;
     private String IClassCode;
     private String IPcIndicator;
     private String ILastName;
     private String IFirstName;
     private String IMinit;
     private String ISuffix;
     private Short IHwobFlag;
     private Short ICountNames;
     private Short ILimitCount;
     private Short IEnemies;
     private Short IEnemiesOf;
     private Short ITotEnemies;
     private String IFpNbr2;
     private Short IFpClass1;
     private Short IFpClass2;
     private String ISmoker;
     private String IResideWithSmoker;
     private Date IDatePhotoTaken;
     private String ISosCode;
     private String ISosLocation;
     private String ISosState;
     private String ISrg;
     private String IBinNumber;
     private Integer IIncarcerationNumber;
     private String VNameField;
     private String VAliasMesg;
     private String VSmoker;
     private String VBillable;
     private String VSrg;

     // Constructors

    /** default constructor */
    public NamesInmateViewId() {
    }

   /** minimal constructor */
    public NamesInmateViewId(String NLastName, String NFirstName, String NMinit, int NInmateId, String NSuffix) {
        this.NLastName = NLastName;
        this.NFirstName = NFirstName;
        this.NMinit = NMinit;
        this.NInmateId = NInmateId;
        this.NSuffix = NSuffix;
    }
    /** full constructor */
    public NamesInmateViewId(String NLastName, String NFirstName, String NMinit, int NInmateId, Date NDob, String NSsno, String NAka, String NSuffix, String NStatus, Integer NIncarcerationNumber, String ISecurityId, String IArea, String ICellId, Date IDob, String IRace, String ISex, String IStatus, String IClassCode, String IPcIndicator, String ILastName, String IFirstName, String IMinit, String ISuffix, Short IHwobFlag, Short ICountNames, Short ILimitCount, Short IEnemies, Short IEnemiesOf, Short ITotEnemies, String IFpNbr2, Short IFpClass1, Short IFpClass2, String ISmoker, String IResideWithSmoker, Date IDatePhotoTaken, String ISosCode, String ISosLocation, String ISosState, String ISrg, String IBinNumber, Integer IIncarcerationNumber, String VNameField, String VAliasMesg, String VSmoker, String VBillable, String VSrg) {
       this.NLastName = NLastName;
       this.NFirstName = NFirstName;
       this.NMinit = NMinit;
       this.NInmateId = NInmateId;
       this.NDob = NDob;
       this.NSsno = NSsno;
       this.NAka = NAka;
       this.NSuffix = NSuffix;
       this.NStatus = NStatus;
       this.NIncarcerationNumber = NIncarcerationNumber;
       this.ISecurityId = ISecurityId;
       this.IArea = IArea;
       this.ICellId = ICellId;
       this.IDob = IDob;
       this.IRace = IRace;
       this.ISex = ISex;
       this.IStatus = IStatus;
       this.IClassCode = IClassCode;
       this.IPcIndicator = IPcIndicator;
       this.ILastName = ILastName;
       this.IFirstName = IFirstName;
       this.IMinit = IMinit;
       this.ISuffix = ISuffix;
       this.IHwobFlag = IHwobFlag;
       this.ICountNames = ICountNames;
       this.ILimitCount = ILimitCount;
       this.IEnemies = IEnemies;
       this.IEnemiesOf = IEnemiesOf;
       this.ITotEnemies = ITotEnemies;
       this.IFpNbr2 = IFpNbr2;
       this.IFpClass1 = IFpClass1;
       this.IFpClass2 = IFpClass2;
       this.ISmoker = ISmoker;
       this.IResideWithSmoker = IResideWithSmoker;
       this.IDatePhotoTaken = IDatePhotoTaken;
       this.ISosCode = ISosCode;
       this.ISosLocation = ISosLocation;
       this.ISosState = ISosState;
       this.ISrg = ISrg;
       this.IBinNumber = IBinNumber;
       this.IIncarcerationNumber = IIncarcerationNumber;
       this.VNameField = VNameField;
       this.VAliasMesg = VAliasMesg;
       this.VSmoker = VSmoker;
       this.VBillable = VBillable;
       this.VSrg = VSrg;
    }
   
   
    // Property accessors
    public String getNLastName() {
        return this.NLastName;
    }
   
    public void setNLastName(String NLastName) {
        this.NLastName = NLastName;
    }
    public String getNFirstName() {
        return this.NFirstName;
    }
   
    public void setNFirstName(String NFirstName) {
        this.NFirstName = NFirstName;
    }
    public String getNMinit() {
        return this.NMinit;
    }
   
    public void setNMinit(String NMinit) {
        this.NMinit = NMinit;
    }
    public int getNInmateId() {
        return this.NInmateId;
    }
   
    public void setNInmateId(int NInmateId) {
        this.NInmateId = NInmateId;
    }
    public Date getNDob() {
        return this.NDob;
    }
   
    public void setNDob(Date NDob) {
        this.NDob = NDob;
    }
    public String getNSsno() {
        return this.NSsno;
    }
   
    public void setNSsno(String NSsno) {
        this.NSsno = NSsno;
    }
    public String getNAka() {
        return this.NAka;
    }
   
    public void setNAka(String NAka) {
        this.NAka = NAka;
    }
    public String getNSuffix() {
        return this.NSuffix;
    }
   
    public void setNSuffix(String NSuffix) {
        this.NSuffix = NSuffix;
    }
    public String getNStatus() {
        return this.NStatus;
    }
   
    public void setNStatus(String NStatus) {
        this.NStatus = NStatus;
    }
    public Integer getNIncarcerationNumber() {
        return this.NIncarcerationNumber;
    }
   
    public void setNIncarcerationNumber(Integer NIncarcerationNumber) {
        this.NIncarcerationNumber = NIncarcerationNumber;
    }
    public String getISecurityId() {
        return this.ISecurityId;
    }
   
    public void setISecurityId(String ISecurityId) {
        this.ISecurityId = ISecurityId;
    }
    public String getIArea() {
        return this.IArea;
    }
   
    public void setIArea(String IArea) {
        this.IArea = IArea;
    }
    public String getICellId() {
        return this.ICellId;
    }
   
    public void setICellId(String ICellId) {
        this.ICellId = ICellId;
    }
    public Date getIDob() {
        return this.IDob;
    }
   
    public void setIDob(Date IDob) {
        this.IDob = IDob;
    }
    public String getIRace() {
        return this.IRace;
    }
   
    public void setIRace(String IRace) {
        this.IRace = IRace;
    }
    public String getISex() {
        return this.ISex;
    }
   
    public void setISex(String ISex) {
        this.ISex = ISex;
    }
    public String getIStatus() {
        return this.IStatus;
    }
   
    public void setIStatus(String IStatus) {
        this.IStatus = IStatus;
    }
    public String getIClassCode() {
        return this.IClassCode;
    }
   
    public void setIClassCode(String IClassCode) {
        this.IClassCode = IClassCode;
    }
    public String getIPcIndicator() {
        return this.IPcIndicator;
    }
   
    public void setIPcIndicator(String IPcIndicator) {
        this.IPcIndicator = IPcIndicator;
    }
    public String getILastName() {
        return this.ILastName;
    }
   
    public void setILastName(String ILastName) {
        this.ILastName = ILastName;
    }
    public String getIFirstName() {
        return this.IFirstName;
    }
   
    public void setIFirstName(String IFirstName) {
        this.IFirstName = IFirstName;
    }
    public String getIMinit() {
        return this.IMinit;
    }
   
    public void setIMinit(String IMinit) {
        this.IMinit = IMinit;
    }
    public String getISuffix() {
        return this.ISuffix;
    }
   
    public void setISuffix(String ISuffix) {
        this.ISuffix = ISuffix;
    }
    public Short getIHwobFlag() {
        return this.IHwobFlag;
    }
   
    public void setIHwobFlag(Short IHwobFlag) {
        this.IHwobFlag = IHwobFlag;
    }
    public Short getICountNames() {
        return this.ICountNames;
    }
   
    public void setICountNames(Short ICountNames) {
        this.ICountNames = ICountNames;
    }
    public Short getILimitCount() {
        return this.ILimitCount;
    }
   
    public void setILimitCount(Short ILimitCount) {
        this.ILimitCount = ILimitCount;
    }
    public Short getIEnemies() {
        return this.IEnemies;
    }
   
    public void setIEnemies(Short IEnemies) {
        this.IEnemies = IEnemies;
    }
    public Short getIEnemiesOf() {
        return this.IEnemiesOf;
    }
   
    public void setIEnemiesOf(Short IEnemiesOf) {
        this.IEnemiesOf = IEnemiesOf;
    }
    public Short getITotEnemies() {
        return this.ITotEnemies;
    }
   
    public void setITotEnemies(Short ITotEnemies) {
        this.ITotEnemies = ITotEnemies;
    }
    public String getIFpNbr2() {
        return this.IFpNbr2;
    }
   
    public void setIFpNbr2(String IFpNbr2) {
        this.IFpNbr2 = IFpNbr2;
    }
    public Short getIFpClass1() {
        return this.IFpClass1;
    }
   
    public void setIFpClass1(Short IFpClass1) {
        this.IFpClass1 = IFpClass1;
    }
    public Short getIFpClass2() {
        return this.IFpClass2;
    }
   
    public void setIFpClass2(Short IFpClass2) {
        this.IFpClass2 = IFpClass2;
    }
    public String getISmoker() {
        return this.ISmoker;
    }
   
    public void setISmoker(String ISmoker) {
        this.ISmoker = ISmoker;
    }
    public String getIResideWithSmoker() {
        return this.IResideWithSmoker;
    }
   
    public void setIResideWithSmoker(String IResideWithSmoker) {
        this.IResideWithSmoker = IResideWithSmoker;
    }
    public Date getIDatePhotoTaken() {
        return this.IDatePhotoTaken;
    }
   
    public void setIDatePhotoTaken(Date IDatePhotoTaken) {
        this.IDatePhotoTaken = IDatePhotoTaken;
    }
    public String getISosCode() {
        return this.ISosCode;
    }
   
    public void setISosCode(String ISosCode) {
        this.ISosCode = ISosCode;
    }
    public String getISosLocation() {
        return this.ISosLocation;
    }
   
    public void setISosLocation(String ISosLocation) {
        this.ISosLocation = ISosLocation;
    }
    public String getISosState() {
        return this.ISosState;
    }
   
    public void setISosState(String ISosState) {
        this.ISosState = ISosState;
    }
    public String getISrg() {
        return this.ISrg;
    }
   
    public void setISrg(String ISrg) {
        this.ISrg = ISrg;
    }
    public String getIBinNumber() {
        return this.IBinNumber;
    }
   
    public void setIBinNumber(String IBinNumber) {
        this.IBinNumber = IBinNumber;
    }
    public Integer getIIncarcerationNumber() {
        return this.IIncarcerationNumber;
    }
   
    public void setIIncarcerationNumber(Integer IIncarcerationNumber) {
        this.IIncarcerationNumber = IIncarcerationNumber;
    }
    public String getVNameField() {
        return this.VNameField;
    }
   
    public void setVNameField(String VNameField) {
        this.VNameField = VNameField;
    }
    public String getVAliasMesg() {
        return this.VAliasMesg;
    }
   
    public void setVAliasMesg(String VAliasMesg) {
        this.VAliasMesg = VAliasMesg;
    }
    public String getVSmoker() {
        return this.VSmoker;
    }
   
    public void setVSmoker(String VSmoker) {
        this.VSmoker = VSmoker;
    }
    public String getVBillable() {
        return this.VBillable;
    }
   
    public void setVBillable(String VBillable) {
        this.VBillable = VBillable;
    }
    public String getVSrg() {
        return this.VSrg;
    }
   
    public void setVSrg(String VSrg) {
        this.VSrg = VSrg;
    }


   public boolean equals(Object other) {
         if ( (this == other ) ) return true;
       if ( (other == null ) ) return false;
       if ( !(other instanceof NamesInmateViewId) ) return false;
       NamesInmateViewId castOther = ( NamesInmateViewId ) other;
         
       return ( (this.getNLastName()==castOther.getNLastName()) || ( this.getNLastName()!=null && castOther.getNLastName()!=null && this.getNLastName().equals(castOther.getNLastName()) ) )
&& ( (this.getNFirstName()==castOther.getNFirstName()) || ( this.getNFirstName()!=null && castOther.getNFirstName()!=null && this.getNFirstName().equals(castOther.getNFirstName()) ) )
&& ( (this.getNMinit()==castOther.getNMinit()) || ( this.getNMinit()!=null && castOther.getNMinit()!=null && this.getNMinit().equals(castOther.getNMinit()) ) )
&& (this.getNInmateId()==castOther.getNInmateId())
&& ( (this.getNDob()==castOther.getNDob()) || ( this.getNDob()!=null && castOther.getNDob()!=null && this.getNDob().equals(castOther.getNDob()) ) )
&& ( (this.getNSsno()==castOther.getNSsno()) || ( this.getNSsno()!=null && castOther.getNSsno()!=null && this.getNSsno().equals(castOther.getNSsno()) ) )
&& ( (this.getNAka()==castOther.getNAka()) || ( this.getNAka()!=null && castOther.getNAka()!=null && this.getNAka().equals(castOther.getNAka()) ) )
&& ( (this.getNSuffix()==castOther.getNSuffix()) || ( this.getNSuffix()!=null && castOther.getNSuffix()!=null && this.getNSuffix().equals(castOther.getNSuffix()) ) )
&& ( (this.getNStatus()==castOther.getNStatus()) || ( this.getNStatus()!=null && castOther.getNStatus()!=null && this.getNStatus().equals(castOther.getNStatus()) ) )
&& ( (this.getNIncarcerationNumber()==castOther.getNIncarcerationNumber()) || ( this.getNIncarcerationNumber()!=null && castOther.getNIncarcerationNumber()!=null && this.getNIncarcerationNumber().equals(castOther.getNIncarcerationNumber()) ) )
&& ( (this.getISecurityId()==castOther.getISecurityId()) || ( this.getISecurityId()!=null && castOther.getISecurityId()!=null && this.getISecurityId().equals(castOther.getISecurityId()) ) )
&& ( (this.getIArea()==castOther.getIArea()) || ( this.getIArea()!=null && castOther.getIArea()!=null && this.getIArea().equals(castOther.getIArea()) ) )
&& ( (this.getICellId()==castOther.getICellId()) || ( this.getICellId()!=null && castOther.getICellId()!=null && this.getICellId().equals(castOther.getICellId()) ) )
&& ( (this.getIDob()==castOther.getIDob()) || ( this.getIDob()!=null && castOther.getIDob()!=null && this.getIDob().equals(castOther.getIDob()) ) )
&& ( (this.getIRace()==castOther.getIRace()) || ( this.getIRace()!=null && castOther.getIRace()!=null && this.getIRace().equals(castOther.getIRace()) ) )
&& ( (this.getISex()==castOther.getISex()) || ( this.getISex()!=null && castOther.getISex()!=null && this.getISex().equals(castOther.getISex()) ) )
&& ( (this.getIStatus()==castOther.getIStatus()) || ( this.getIStatus()!=null && castOther.getIStatus()!=null && this.getIStatus().equals(castOther.getIStatus()) ) )
&& ( (this.getIClassCode()==castOther.getIClassCode()) || ( this.getIClassCode()!=null && castOther.getIClassCode()!=null && this.getIClassCode().equals(castOther.getIClassCode()) ) )
&& ( (this.getIPcIndicator()==castOther.getIPcIndicator()) || ( this.getIPcIndicator()!=null && castOther.getIPcIndicator()!=null && this.getIPcIndicator().equals(castOther.getIPcIndicator()) ) )
&& ( (this.getILastName()==castOther.getILastName()) || ( this.getILastName()!=null && castOther.getILastName()!=null && this.getILastName().equals(castOther.getILastName()) ) )
&& ( (this.getIFirstName()==castOther.getIFirstName()) || ( this.getIFirstName()!=null && castOther.getIFirstName()!=null && this.getIFirstName().equals(castOther.getIFirstName()) ) )
&& ( (this.getIMinit()==castOther.getIMinit()) || ( this.getIMinit()!=null && castOther.getIMinit()!=null && this.getIMinit().equals(castOther.getIMinit()) ) )
&& ( (this.getISuffix()==castOther.getISuffix()) || ( this.getISuffix()!=null && castOther.getISuffix()!=null && this.getISuffix().equals(castOther.getISuffix()) ) )
&& ( (this.getIHwobFlag()==castOther.getIHwobFlag()) || ( this.getIHwobFlag()!=null && castOther.getIHwobFlag()!=null && this.getIHwobFlag().equals(castOther.getIHwobFlag()) ) )
&& ( (this.getICountNames()==castOther.getICountNames()) || ( this.getICountNames()!=null && castOther.getICountNames()!=null && this.getICountNames().equals(castOther.getICountNames()) ) )
&& ( (this.getILimitCount()==castOther.getILimitCount()) || ( this.getILimitCount()!=null && castOther.getILimitCount()!=null && this.getILimitCount().equals(castOther.getILimitCount()) ) )
&& ( (this.getIEnemies()==castOther.getIEnemies()) || ( this.getIEnemies()!=null && castOther.getIEnemies()!=null && this.getIEnemies().equals(castOther.getIEnemies()) ) )
&& ( (this.getIEnemiesOf()==castOther.getIEnemiesOf()) || ( this.getIEnemiesOf()!=null && castOther.getIEnemiesOf()!=null && this.getIEnemiesOf().equals(castOther.getIEnemiesOf()) ) )
&& ( (this.getITotEnemies()==castOther.getITotEnemies()) || ( this.getITotEnemies()!=null && castOther.getITotEnemies()!=null && this.getITotEnemies().equals(castOther.getITotEnemies()) ) )
&& ( (this.getIFpNbr2()==castOther.getIFpNbr2()) || ( this.getIFpNbr2()!=null && castOther.getIFpNbr2()!=null && this.getIFpNbr2().equals(castOther.getIFpNbr2()) ) )
&& ( (this.getIFpClass1()==castOther.getIFpClass1()) || ( this.getIFpClass1()!=null && castOther.getIFpClass1()!=null && this.getIFpClass1().equals(castOther.getIFpClass1()) ) )
&& ( (this.getIFpClass2()==castOther.getIFpClass2()) || ( this.getIFpClass2()!=null && castOther.getIFpClass2()!=null && this.getIFpClass2().equals(castOther.getIFpClass2()) ) )
&& ( (this.getISmoker()==castOther.getISmoker()) || ( this.getISmoker()!=null && castOther.getISmoker()!=null && this.getISmoker().equals(castOther.getISmoker()) ) )
&& ( (this.getIResideWithSmoker()==castOther.getIResideWithSmoker()) || ( this.getIResideWithSmoker()!=null && castOther.getIResideWithSmoker()!=null && this.getIResideWithSmoker().equals(castOther.getIResideWithSmoker()) ) )
&& ( (this.getIDatePhotoTaken()==castOther.getIDatePhotoTaken()) || ( this.getIDatePhotoTaken()!=null && castOther.getIDatePhotoTaken()!=null && this.getIDatePhotoTaken().equals(castOther.getIDatePhotoTaken()) ) )
&& ( (this.getISosCode()==castOther.getISosCode()) || ( this.getISosCode()!=null && castOther.getISosCode()!=null && this.getISosCode().equals(castOther.getISosCode()) ) )
&& ( (this.getISosLocation()==castOther.getISosLocation()) || ( this.getISosLocation()!=null && castOther.getISosLocation()!=null && this.getISosLocation().equals(castOther.getISosLocation()) ) )
&& ( (this.getISosState()==castOther.getISosState()) || ( this.getISosState()!=null && castOther.getISosState()!=null && this.getISosState().equals(castOther.getISosState()) ) )
&& ( (this.getISrg()==castOther.getISrg()) || ( this.getISrg()!=null && castOther.getISrg()!=null && this.getISrg().equals(castOther.getISrg()) ) )
&& ( (this.getIBinNumber()==castOther.getIBinNumber()) || ( this.getIBinNumber()!=null && castOther.getIBinNumber()!=null && this.getIBinNumber().equals(castOther.getIBinNumber()) ) )
&& ( (this.getIIncarcerationNumber()==castOther.getIIncarcerationNumber()) || ( this.getIIncarcerationNumber()!=null && castOther.getIIncarcerationNumber()!=null && this.getIIncarcerationNumber().equals(castOther.getIIncarcerationNumber()) ) )
&& ( (this.getVNameField()==castOther.getVNameField()) || ( this.getVNameField()!=null && castOther.getVNameField()!=null && this.getVNameField().equals(castOther.getVNameField()) ) )
&& ( (this.getVAliasMesg()==castOther.getVAliasMesg()) || ( this.getVAliasMesg()!=null && castOther.getVAliasMesg()!=null && this.getVAliasMesg().equals(castOther.getVAliasMesg()) ) )
&& ( (this.getVSmoker()==castOther.getVSmoker()) || ( this.getVSmoker()!=null && castOther.getVSmoker()!=null && this.getVSmoker().equals(castOther.getVSmoker()) ) )
&& ( (this.getVBillable()==castOther.getVBillable()) || ( this.getVBillable()!=null && castOther.getVBillable()!=null && this.getVBillable().equals(castOther.getVBillable()) ) )
&& ( (this.getVSrg()==castOther.getVSrg()) || ( this.getVSrg()!=null && castOther.getVSrg()!=null && this.getVSrg().equals(castOther.getVSrg()) ) );
   }
   
   public int hashCode() {
         int result = 17;
         
         result = 37 * result + ( getNLastName() == null ? 0 : this.getNLastName().hashCode() );
         result = 37 * result + ( getNFirstName() == null ? 0 : this.getNFirstName().hashCode() );
         result = 37 * result + ( getNMinit() == null ? 0 : this.getNMinit().hashCode() );
         result = 37 * result + this.getNInmateId();
         result = 37 * result + ( getNDob() == null ? 0 : this.getNDob().hashCode() );
         result = 37 * result + ( getNSsno() == null ? 0 : this.getNSsno().hashCode() );
         result = 37 * result + ( getNAka() == null ? 0 : this.getNAka().hashCode() );
         result = 37 * result + ( getNSuffix() == null ? 0 : this.getNSuffix().hashCode() );
         result = 37 * result + ( getNStatus() == null ? 0 : this.getNStatus().hashCode() );
         result = 37 * result + ( getNIncarcerationNumber() == null ? 0 : this.getNIncarcerationNumber().hashCode() );
         result = 37 * result + ( getISecurityId() == null ? 0 : this.getISecurityId().hashCode() );
         result = 37 * result + ( getIArea() == null ? 0 : this.getIArea().hashCode() );
         result = 37 * result + ( getICellId() == null ? 0 : this.getICellId().hashCode() );
         result = 37 * result + ( getIDob() == null ? 0 : this.getIDob().hashCode() );
         result = 37 * result + ( getIRace() == null ? 0 : this.getIRace().hashCode() );
         result = 37 * result + ( getISex() == null ? 0 : this.getISex().hashCode() );
         result = 37 * result + ( getIStatus() == null ? 0 : this.getIStatus().hashCode() );
         result = 37 * result + ( getIClassCode() == null ? 0 : this.getIClassCode().hashCode() );
         result = 37 * result + ( getIPcIndicator() == null ? 0 : this.getIPcIndicator().hashCode() );
         result = 37 * result + ( getILastName() == null ? 0 : this.getILastName().hashCode() );
         result = 37 * result + ( getIFirstName() == null ? 0 : this.getIFirstName().hashCode() );
         result = 37 * result + ( getIMinit() == null ? 0 : this.getIMinit().hashCode() );
         result = 37 * result + ( getISuffix() == null ? 0 : this.getISuffix().hashCode() );
         result = 37 * result + ( getIHwobFlag() == null ? 0 : this.getIHwobFlag().hashCode() );
         result = 37 * result + ( getICountNames() == null ? 0 : this.getICountNames().hashCode() );
         result = 37 * result + ( getILimitCount() == null ? 0 : this.getILimitCount().hashCode() );
         result = 37 * result + ( getIEnemies() == null ? 0 : this.getIEnemies().hashCode() );
         result = 37 * result + ( getIEnemiesOf() == null ? 0 : this.getIEnemiesOf().hashCode() );
         result = 37 * result + ( getITotEnemies() == null ? 0 : this.getITotEnemies().hashCode() );
         result = 37 * result + ( getIFpNbr2() == null ? 0 : this.getIFpNbr2().hashCode() );
         result = 37 * result + ( getIFpClass1() == null ? 0 : this.getIFpClass1().hashCode() );
         result = 37 * result + ( getIFpClass2() == null ? 0 : this.getIFpClass2().hashCode() );
         result = 37 * result + ( getISmoker() == null ? 0 : this.getISmoker().hashCode() );
         result = 37 * result + ( getIResideWithSmoker() == null ? 0 : this.getIResideWithSmoker().hashCode() );
         result = 37 * result + ( getIDatePhotoTaken() == null ? 0 : this.getIDatePhotoTaken().hashCode() );
         result = 37 * result + ( getISosCode() == null ? 0 : this.getISosCode().hashCode() );
         result = 37 * result + ( getISosLocation() == null ? 0 : this.getISosLocation().hashCode() );
         result = 37 * result + ( getISosState() == null ? 0 : this.getISosState().hashCode() );
         result = 37 * result + ( getISrg() == null ? 0 : this.getISrg().hashCode() );
         result = 37 * result + ( getIBinNumber() == null ? 0 : this.getIBinNumber().hashCode() );
         result = 37 * result + ( getIIncarcerationNumber() == null ? 0 : this.getIIncarcerationNumber().hashCode() );
         result = 37 * result + ( getVNameField() == null ? 0 : this.getVNameField().hashCode() );
         result = 37 * result + ( getVAliasMesg() == null ? 0 : this.getVAliasMesg().hashCode() );
         result = 37 * result + ( getVSmoker() == null ? 0 : this.getVSmoker().hashCode() );
         result = 37 * result + ( getVBillable() == null ? 0 : this.getVBillable().hashCode() );
         result = 37 * result + ( getVSrg() == null ? 0 : this.getVSrg().hashCode() );
         return result;
   }   


}



My question is: Is there any way to tell Hibernate Tool what column(s) to use as the primary key on a view or a table that does not have a primary key defined on it in the schema so that this does not happen?

Secondly, if there is not a way to tell the tool which fields to use as the pkey on views, can the tool be changed so that it just ignores the fact that there is no pkey defined?

The reasoning being, it would be much easier to modify the files to add the definition of the pkey on the views than it is to undo the mess that it is creating now.

_________________
-Scott-


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 4:44 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use a reveng.xml with a primary-key setting for your "table".

p.s we setup a id since otherwise the generated hbm.xml would be invalid generating even more unneeded traffic to the forums ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 9:48 am 
Newbie

Joined: Thu Feb 19, 2004 10:25 pm
Posts: 16
Thanks... this worked on both tables and views. The only problem I have now is that I have 136 views to do and who knows how meny tables... : (

_________________
-Scott-


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 1:11 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
is there some pattern that you can use to recognize the columns that shold be the primarykey ?

if yes then implementing a custom reverseengineeringstrategy allows you to implement that "pattern" and for the rest delegate to the default strategy.

_________________
Max
Don't forget to rate


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

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.