persistence@glassfish.java.net

Re: don't have a unique key for ID in my view

From: Craig L Russell <Craig.Russell_at_Sun.COM>
Date: Tue, 31 Jul 2007 13:09:04 -0700

Hi Sud,

Entities need to have a unique id in JPA.

If you want persistent data that isn't unique, you might look at JDO
or JDBC, both of which support non-unique data tables as modeling
artifacts.

Craig

On Jul 31, 2007, at 1:25 AM, Eve Pokua wrote:

> Sud,
>
>
> You may want to consider IdClass or Embeddable class.
>
> eve
>
> Date: Wed, 25 Jul 2007 06:20:30 -0700
> From: to_sud_at_yahoo.com
> To: persistence_at_glassfish.dev.java.net
> Subject: don't have a unique key for ID in my view
>
> I have a view that has neither a unique key nor a composite unique
> key. I have no way to specify a unique key for this view. But JPA
> Entities are required to have a unique Id field. How can I use JPA
> with my view.
>
> Thanks
> -sud
>
> Take the Internet to Go: Yahoo!Go puts the Internet in your pocket:
> mail, news, photos & more.
>
> Are you the Quizmaster? Play BrainBattle with a friend now!

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell_at_sun.com
P.S. A good JDO? O, Gasp!