persistence@glassfish.java.net

Re: JPA error

From: Peter Ondru?ka <peter.ondruska_at_gmail.com>
Date: Sat, 22 Aug 2009 16:44:05 +0200

OK, but look at your equals, any Movie.equals (anyotherMovie), should be

if (this.property1 == object.property1 && ... ) return true

On Sat, Aug 22, 2009 at 4:09 PM, measwel <marek_karczewski_at_yahoo.com.au>wrote:

>
> Yes, here is the code:
>
> @Override
> public boolean equals(Object object) {
> if (object == null || !this.getClass().equals(object.getClass())) {
> return false;
> }
>
> Movie other = (Movie) object;
> if (this.movieID != other.movieID && (this.movieID == null ||
> !this.movieID.equals(other.movieID))) {
> return false;
> }
>
> return true;
> }
>
> The comparison works correctly, if I get the user reference from the entity
> manager. Is that a correct thing to do?
>
> Also : now sometimes if I wait for a long time I get the following error
> when trying to create a new favorite after waiting for a few minutes:
>
> Cannot find faces context.
>
> I am currently waiting to recreate the error, so I can post the error
> stack.
> --
> View this message in context:
> http://www.nabble.com/JPA-error-tp25092854p25094165.html
> Sent from the java.net - glassfish persistence mailing list archive at
> Nabble.com.
>
>