« Return to Thread: Search by ID java.lang.ClassCastException

RE: Search by ID java.lang.ClassCastException

by nhhockeyplayer :: Rate this Message:

Reply to Author | View in Thread

Hey Ghach... cool glad you resolved it.
 
Still curious if I am the only guy on the planet that uses OneToOne in trails. If your domain model matures I'd sure like to know if trails delivers for you in this regard.

Best regards
Ken in nashua




 

> Date: Sun, 8 Mar 2009 16:11:02 -0700
> From: ghachey@...
> To: users@...
> Subject: RE: [trails-users] Search by ID java.lang.ClassCastException
>
>
> Hey Ken,
>
> >At first glance I would refrain from using
> EqualsBuilder.reflectionEquals(this, obj);
> > within your equals method. Don't recall but a bit back I ran into a
> > problem operating that.
>
> Yeah I usually don't use it. I just tried this once.
>
> >Also, might want to try setting your id to null instead of 1L... just to
> try and shake it out. Shouldn't really have to set it to >anything, although
> someone picky will shout up some best practice, it don't really matter.
>
> I had tried that but did not make any difference.
>
> >I used Integer for my ID's within the roster demo. And I highly suggest you
> refer to the same demo for canonical usage >of ID's, equals and hashcode for
> your domain objects.
>
> The only reason I went with Long was that this project is a port of an
> existing database and for some reason they have insanely huge IDs. However,
> it'll be a while before it reaches the Integer limit so I went back to using
> Integer. I don't get the error message anymore so thats good but still
> don't have an understanding of the problem I had unfortunately. Ha well...
>
> Thanks,
>
> --
> GH
> --
> View this message in context: http://www.nabble.com/Search-by-ID-java.lang.ClassCastException-tp22384565p22404287.html
> Sent from the Trails - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>


Windows Liveā„¢: Keep your life in sync. Check it out.
Best regards
Ken in nashua

 « Return to Thread: Search by ID java.lang.ClassCastException