Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Mapping a Database View

Yeah that's the rub working with views, you'll either have to change
your view to have a unique id or make a multi-column @Id that's
reasonably unique across the view.

./tch



On Fri, Sep 11, 2009 at 10:21 AM, RogerV <roger.varley@xxxxxxxxxxxxxx> wrote:
>
>
>
> tch wrote:
>>
>> It's the exact same way as for a table, no different. Though you may
>> want to make your columns read only obviously.
>>
>> Also make sure your view has a primary key that is unique.
>>
>> ./tch
>>
>
> The database view in question is over two tables in a MySQL database and has
> no primary key definable at the view level within the database - although it
> does contain the primary key fields for the table. So when I use the JPA
> mapping tool Eclipse complains that there is no @Id mapping.
>
> Regards
>
> --
> View this message in context: http://www.nabble.com/Mapping-a-Database-View-tp25401383p25401857.html
> Sent from the EclipseLink - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
>


Back to the top