Skip to main content


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 13:10 Go to next message
Gary Godfrey is currently offline Gary GodfreyFriend
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 16:02 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
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 14:01 Go to previous messageGo to next message
Gary Godfrey is currently offline Gary GodfreyFriend
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 15:51 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
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: Sat Apr 20 02:18:55 GMT 2024

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

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

Back to the top