Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [TEXO] Uniqueness constraint
[TEXO] Uniqueness constraint [message #1582881] Sat, 24 January 2015 22:34 Go to next message
Mr Cur is currently offline Mr CurFriend
Messages: 31
Registered: September 2014
Member
Hi,

Is it possible to set in an annotation model a multi-attribute uniqueness constraint for a tabe?

Thanks,

Cur
Re: [TEXO] Uniqueness constraint [message #1586071 is a reply to message #1582881] Mon, 26 January 2015 16:54 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cur,
The JPA unique constraint allows multiple column names. See the attached screenshot for an example, so create the
following elements in an annotations model:
- annotated eclass
- orm annotation
- entity
- table
- uniqueconstraint with multiple column names


the example from the attached screenshort gives the following java code:
@Entity(name = "Bz423155_Main423155")
@Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "abc", "def" }, name = "my unique constraint") })
public class Main423155 {

gr. Martin

On 24-01-15 23:34, Mr Cur wrote:
> Hi,
>
> Is it possible to set in an annotation model a multi-attribute uniqueness constraint for a tabe?
>
> Thanks,
>
> Cur


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: [TEXO] Uniqueness constraint [message #1586251 is a reply to message #1586071] Mon, 26 January 2015 19:09 Go to previous message
Mr Cur is currently offline Mr CurFriend
Messages: 31
Registered: September 2014
Member
Hi Martin,

Thanks.
This was what I was looking.

All the best,

Cur
Previous Topic:EMFStore and Edapt
Next Topic:do I have the correct download for the EMF plugin
Goto Forum:
  


Current Time: Wed Apr 08 09:49:29 GMT 2020

Powered by FUDForum. Page generated in 0.01553 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top