Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [TEXO] JPA entity names
[TEXO] JPA entity names [message #901569] Mon, 13 August 2012 09:10 Go to next message
Gary Godfrey is currently offline Gary Godfrey
Messages: 31
Registered: February 2012
Member
Hi,

I have upgraded to the latest TEXO release and the entity names are now including the NS prefix. Previously the @Entity annotation would just have the same name as the Java class.

e.g.

NOW
@Entity(name = "fraud_Applicant")
public class Applicant

PREVIOUSLY
@Entity(name = "Applicant")
public class Applicant


I need the generated class to exclude the NS prefix. I have tried removing the value from ecore model Ns Prefix but this gives me the value:
@Entity(name = "_Applicant")


Is there a way to generate the 'old' entity name please?

Regards,
Gary
Re: [TEXO] JPA entity names [message #901604 is a reply to message #901569] Mon, 13 August 2012 12:02 Go to previous messageGo to next message
Martin Taal is currently offline Martin Taal
Messages: 5326
Registered: July 2009
Senior Member
Hi Gary,
Yes,I changed this 1-2 months back, see here:
http://www.eclipse.org/forums/index.php/m/880129/

This specific option is enforceUniqueNames, so it is quite easy to get the old behavior.

gr. Martin

On 08/13/2012 03:10 PM, Gary Godfrey wrote:
> Hi,
>
> I have upgraded to the latest TEXO release and the entity names are now including the NS prefix. Previously the @Entity
> annotation would just have the same name as the Java class.
>
> e.g.
>
> NOW
> @Entity(name = "fraud_Applicant")
> public class Applicant
>
> PREVIOUSLY
> @Entity(name = "Applicant")
> public class Applicant
>
> I need the generated class to exclude the NS prefix. I have tried removing the value from ecore model Ns Prefix but this
> gives me the value:
> @Entity(name = "_Applicant")
>
> Is there a way to generate the 'old' entity name please?
>
> Regards,
> Gary


--

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] JPA entity names [message #901772 is a reply to message #901604] Tue, 14 August 2012 10:01 Go to previous messageGo to next message
Gary Godfrey is currently offline Gary Godfrey
Messages: 31
Registered: February 2012
Member
Hi Martin,

I have generated ORM annotations model and renamed it to be called .annotationsmodel.

Setting enforceUniqueNames to true or false does not alter the @Entity annotation being created on the classes.

Are there any other settings I need to change please?

Regards,
Gary
Re: [TEXO] JPA entity names [message #901801 is a reply to message #901772] Tue, 14 August 2012 11:51 Go to previous message
Martin Taal is currently offline Martin Taal
Messages: 5326
Registered: July 2009
Senior Member
Hi Gary,
The orm annotations model will have entity names in it, in this case the option is not used. You should only use an
annotations model to override specific things in the ORM generation, so not for the complete model (normally, if you
were doing that).
What happens if you remove the annotationsmodel file, does that help?

gr. Martin

On 08/14/2012 04:01 PM, Gary Godfrey wrote:
> Hi Martin,
>
> I have generated ORM annotations model and renamed it to be called .annotationsmodel.
>
> Setting enforceUniqueNames to true or false does not alter the @Entity annotation being created on the classes.
>
> Are there any other settings I need to change please?
>
> Regards,
> Gary


--

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
Previous Topic:[TEXO] transient
Next Topic:[TEXO] annotations
Goto Forum:
  


Current Time: Thu Jul 31 16:00:50 EDT 2014

Powered by FUDForum. Page generated in 0.01596 seconds