Here is the error stack: [WLServer TmsServer] javax.ejb.EJBException: nested exception is: <0|false|0.9.7> org.apache.openjpa.persistence.PersistenceException: The id type "class com.werner.accounting.model.PeoplesoftSegmentEntity$PeoplesoftSegmentId" specfied by persistent type "class com.wer er.accounting.model.PeoplesoftSegmentEntity" does not have a public string or class + string constructor. [WLServer TmsServer] <0|false|0.9.7> org.apache.openjpa.persistence.PersistenceException: The id type "class com.werner.accounting.mod l.PeoplesoftSegmentEntity$PeoplesoftSegmentId" specfied by persistent type "class com.werner.accounting.model.PeoplesoftSegmentEntity" does not have a public string or class + string constructor. [WLServer TmsServer] at org.apache.openjpa.kernel.BrokerImpl.newObjectId(BrokerImpl.java:1120) [WLServer TmsServer] at org.apache.openjpa.kernel.DelegatingBroker.newObjectId(DelegatingBroker.java:254) [WLServer TmsServer] at org.apache.openjpa.persistence.EntityManagerImpl.find(EntityManagerImpl.java:345) [WLServer TmsServer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
BTW, I didn't find any IdClass test cases in OpenJPA test suit. Thanks Gene. > Date: Mon, 10 Sep 2007 22:15:36 -0700 > From: [EMAIL PROTECTED] > To: [email protected] > Subject: Re: ID class: no public string or class + string constructor? > > > I got the same exception. > > nested exception is: <0|false|0.9.7> > org.apache.openjpa.persistence.PersistenceException: The id type "class > com.werner.accounting.model.PeoplesoftSegmentId" specfied by persistent type > "class com.werner.accounting.model.PeoplesoftSegmentEntity" does not have a > public string or class + string constructor > > ID Class is: > > public class PeoplesoftSegmentId implements Serializable { > > public String _businessUnit; > > public String _vasTourId; > > /** Creates a new instance of PeoplesoftSegmentId */ > public PeoplesoftSegmentId() { > > } > > > @Override > public int hashCode() { > > int hash = 0; > hash += (this._businessUnit != null ? > this._businessUnit.hashCode() : 0); > hash += (this._vasTourId != null ? this._vasTourId.hashCode() : > 0); > return hash; > } > > @Override > public boolean equals(Object object) { > > if(!(object instanceof PeoplesoftSegmentId)) { > return false; > } > PeoplesoftSegmentId other = (PeoplesoftSegmentId)object; > if(this._businessUnit != other._businessUnit > && (this._businessUnit == null || > !this._businessUnit.equals(other._businessUnit))) > return false; > if(this._vasTourId != other._vasTourId > && (this._vasTourId == null || > !this._vasTourId.equals(other._vasTourId))) > return false; > return true; > } > > public String toString() { > return _businessUnit + ":" + _vasTourId; > } > } > > Entity Class is: > @Entity > @IdClass(PeoplesoftSegmentId.class) > public class PeoplesoftSegmentEntity implements Serializable { > > @Id > private String _businessUnit; > > @Id > private String _vasTourId; > > ... > > Thanks > > Gene. > > > Craig L Russell wrote: > > > > Are you using @Id or @IdClass or @EmbeddedId annotations? > > > > I'm looking at 2.1.4, 9.1.14, and 9.1.15 and trying to figure out > > which case you're having trouble with. > > > > Craig > > > > On Mar 26, 2007, at 5:37 PM, Craig L Russell wrote: > > > >> Hi Jeff, > >> > >> It would be useful if you could include a code fragment and the @Id > >> annotation for your class to diagnose this. > >> > >> Thanks, > >> > >> Craig > >> > >> On Mar 26, 2007, at 4:35 PM, jeff wrote: > >> > >>> getting this error: > >>> > >>> The id type "class com.sun.portal.pom.FooId" specfied by > >>> persistent type "class com.sun.portal.pom.Foo" does not have a > >>> public string or class + string constructor. > >>> > >>> this error doesn't seem to correspond to any of the requirements > >>> of an ID class as defined in the spec. > >>> > >>> my first guess is that it wants me to add an constructor that > >>> takes the result of toString() and constructs the ID class based > >>> on that, but adding a constructor that takes a string arg didn't > >>> change the error. i don't understand what it would want for the > >>> "class + string" constructor, so i was not sure what to try there. > >>> > >>> can someone help interpret this error? > >>> thanks! > >>> > >>> > >>> > >>> > >>> --------------------------------- > >>> Never miss an email again! > >>> Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out. > >> > >> Craig Russell > >> DB PMC, OpenJPA PPMC > >> [EMAIL PROTECTED] http://db.apache.org/jdo > >> > >> > > > > Craig Russell > > Architect, Sun Java Enterprise System http://java.sun.com/products/jdo > > 408 276-5638 mailto:[EMAIL PROTECTED] > > P.S. A good JDO? O, Gasp! > > > > > > > > > > -- > View this message in context: > http://www.nabble.com/ID-class%3A-no-public-string-or-class-%2B-string-constructor--tf3470194.html#a12608201 > Sent from the OpenJPA Developers mailing list archive at Nabble.com. > _________________________________________________________________ Capture your memories in an online journal! http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
