|
Re: [TEXO] Failed to create the FK [message #1142441 is a reply to message #1142354] |
Thu, 17 October 2013 16:23 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Simone,
Normally the ORM takes care of creating the database schema on the basis of the annotations. The annotations look fine
to me.
Which ORM are you using?
gr. Martin
On 10/17/2013 05:53 PM, Simone Dionisi wrote:
> Hi,
>
> I was trying to re-use the example in Texo (org.eclipse.emf.texo.web.example) substituting the library model with my
> model and I saw that when I try to generate the test data the application creates the database without creating the
> foreign keys.
>
> Here is my code:
> @Table(name = "SYS_ELMT")
> public class SystemElement extends SpaceSystemObject {
> @Id()
> @Column(name = "sys_elmt_id")
> private String id = null
>
> @Basic()
> @Column(name = "parent_sys_elmt_id")
> @ManyToOne()
> @JoinColumns({ @JoinColumn(name = "parent_sys_elmt_id", referencedColumnName = "sys_elmt_id", table = "SYS_ELMT",
> updatable = true) })
> private String parentSystemElement = null;
>
> .....
>
> }
>
> Could anyone please help me?
>
> Thanks in advance
>
>
--
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] Failed to create the FK [message #1142814 is a reply to message #1142453] |
Thu, 17 October 2013 21:48 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hey Simone,
My question is more what JPA solution you use, hibernate or eclipselink or something else?
Also, you say that no FK's are generated, did you check in the database itself for this?
(I ask because on the basis of the annotation you showed the FK should be generated by the ORM layer)
gr. Martin
On 10/17/2013 06:33 PM, Simone Dionisi wrote:
> Hi Martin,
> thanks for your reply.
> I am using JPA with Postgres as RDBMS.
>
> Best regards
--
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
|
|
|
Powered by
FUDForum. Page generated in 0.03475 seconds