Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [TEXO] Object Embeddable
[TEXO] Object Embeddable [message #854883] Tue, 24 April 2012 10:21 Go to next message
gabriele Mising name is currently offline gabriele Mising nameFriend
Messages: 19
Registered: December 2009
Junior Member
Hello,

I am using TEXO. I created a model (address-test.ecore) with 2 object: Customer and Address.
I created a custom ORM annotated model (address-test-orm.annotationsmodel) :
- Customer mapped as @Entity
- Address mapped as @Embeddable (stereotype '@Entity' removed)

I would like to obtain this result in generation:

@Entity(name = "Customer")
public class Customer {
    @Embedded private Address address = null;
    .....
}

@Embeddable()
public class Address {
	@Basic(optional = true) private String city = null;
	@Basic(optional = true)	private String street = null;
        .....
}


but, TEXO always generates two entity:

@Entity(name = "Customer")
public class Customer {
    
    @ManyToOne(cascade = { CascadeType.ALL }, optional = true, targetEntity = Address.class)
    @JoinColumns({ @JoinColumn() })
    private Address address = null;
    .....
}

@Entity(name = "Address ")
@Embeddable()
public class Address {
	@Basic(optional = true) private String city = null;
	@Basic(optional = true)	private String street = null;
        .....
}


Can you help me?



Re: [TEXO] Object Embeddable [message #856056 is a reply to message #854883] Wed, 25 April 2012 10:22 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Gabriele,
This is a bug, I entered a bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=377606

and pushed a fix for it, am doing a new build right now. Will answer here after I publish a new build.

Note that the EclipseLink orm supports different properties for Embedded and Embeddable, but for Texo these ones are
disabled for now (is more jpa compliant).

gr. Martin

On 04/24/2012 12:21 PM, gabriele Mising name wrote:
> Hello,
>
> I am using TEXO. I created a model (address-test.ecore) with 2 object: Customer and Address.
> I created a custom ORM annotated model (address-test-orm.annotationsmodel) :
> - Customer mapped as @Entity
> - Address mapped as @Embeddable (stereotype '@Entity' removed)
>
> I would like to obtain this result in generation:
>
>
> @Entity(name = "Customer")
> public class Customer {
> @Embedded private Address address = null;
> .....
> }
>
> @Embeddable()
> public class Address {
> @Basic(optional = true) private String city = null;
> @Basic(optional = true) private String street = null;
> .....
> }
>
>
> but, TEXO always generates two entity:
>
>
> @Entity(name = "Customer")
> public class Customer {
>
> @ManyToOne(cascade = { CascadeType.ALL }, optional = true, targetEntity = Address.class)
> @JoinColumns({ @JoinColumn() })
> private Address address = null;
> .....
> }
>
> @Entity(name = "Address ")
> @Embeddable()
> public class Address {
> @Basic(optional = true) private String city = null;
> @Basic(optional = true) private String street = null;
> .....
> }
>
>
> Can you help me?
>
>
>
>


--

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] Object Embeddable [message #856430 is a reply to message #854883] Wed, 25 April 2012 16:45 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Gabriele,
I published a new build which should solve this issue.

gr. Martin


On 04/24/2012 12:21 PM, gabriele Mising name wrote:
> Hello,
>
> I am using TEXO. I created a model (address-test.ecore) with 2 object: Customer and Address.
> I created a custom ORM annotated model (address-test-orm.annotationsmodel) :
> - Customer mapped as @Entity
> - Address mapped as @Embeddable (stereotype '@Entity' removed)
>
> I would like to obtain this result in generation:
>
>
> @Entity(name = "Customer")
> public class Customer {
> @Embedded private Address address = null;
> .....
> }
>
> @Embeddable()
> public class Address {
> @Basic(optional = true) private String city = null;
> @Basic(optional = true) private String street = null;
> .....
> }
>
>
> but, TEXO always generates two entity:
>
>
> @Entity(name = "Customer")
> public class Customer {
>
> @ManyToOne(cascade = { CascadeType.ALL }, optional = true, targetEntity = Address.class)
> @JoinColumns({ @JoinColumn() })
> private Address address = null;
> .....
> }
>
> @Entity(name = "Address ")
> @Embeddable()
> public class Address {
> @Basic(optional = true) private String city = null;
> @Basic(optional = true) private String street = null;
> .....
> }
>
>
> Can you help me?
>
>
>
>


--

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: Loading an Ecore meta-model from a model instance using "Load Resource.."
Next Topic:[EEF] looking for a updated tutorial
Goto Forum:
  


Current Time: Thu Apr 25 21:19:30 GMT 2024

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

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

Back to the top