[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [eclipselink-users] Mapping a Database View
|
- From: Tim Hollosy <hollosyt@xxxxxxxxx>
- Date: Fri, 11 Sep 2009 10:26:36 -0400
- Delivered-to: eclipselink-users@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=7PDLDoCC4lbEEBglNeBHxu3zgJ/UIoUf1v/uqnT6uwA=; b=imoI0zGNcM8vHirVLjlOe4WUOnAacc9ytURjsrsnK5dwc5rR5OUIaNugp7OHbk5HfD fhPO3lkoSDX1/ztEb2RXG6Y/4HylAoRzoJjBSiemNerFGdL1qhiubMd9az3txI7at/Rs rMIyAXN6nrP/wM3rzPQHmypujkreb2x1+uj68=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=CkQU5MlUewtAKhJN1SSypAt+uWP42sHurG+1ZT47JnJTiP/48Tie3DrGrxmTOcq1M1 FspXT9TERPUloM89LwTrD30H2kxxNGdVY+r4xB6yW0XR1O6TxgM0w3x7M1aKKyY2tQoz klLEXKLFQiTPzYxIFN4TnQ1/h5IuLWpqV58GE=
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
>