Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] 3 way join, how to do?
[Teneo] 3 way join, how to do? [message #113984] Thu, 06 March 2008 12:26 Go to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi,

I am adapting a security service to use Teneo as the persistance layer.
The original system had a Role table, a Group table, a Permission table
and a User table. There was a table to join the Group, User and Role
information together. e.g. USER_GROUP_ROLE primary key (USER_ID,
GROUP_ID, ROLE_ID).

I am using the teneo.jpa annotations but from the examples cannot work
out how I woudl represent this, or whether I need to create an element
that actually models this.

A couple of small things I noticed too.

eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
is used int he examples, this no longer exist is and I cannot find it. I
wanted to see the full set of XMLType values.

A more general thing, I worked on a project (dentaku at codehaus.org)
where we use stereotypes and tagged values in the UML to specify column
types and lengths etc. Then generated the Hibernate file from that. With
ECore there does not seem to be a way to do this so you end up with a
messy process, UML model then hand edit the ECore created from it to add
teneo.jap annotations. Any way of improving this? A second difficulty is
that with large XSDs produced as part of a standard it would be nice
if you could have the teneo.jpa annotations in a separate file so that
when a new version of that standard is released it is easier to manage
the changes, the only way to automate this I can see now is to write a
mega XSLT script to merge two files to add the teneo annotations to the
standard XSD.

Thx.

David
Re: [Teneo] 3 way join, how to do? [message #113997 is a reply to message #113984] Thu, 06 March 2008 13:03 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi David,
See my comments inline.

gr. Martin

david wrote:
> Hi,
>
> I am adapting a security service to use Teneo as the persistance layer.
> The original system had a Role table, a Group table, a Permission table
> and a User table. There was a table to join the Group, User and Role
> information together. e.g. USER_GROUP_ROLE primary key (USER_ID,
> GROUP_ID, ROLE_ID).
>
> I am using the teneo.jpa annotations but from the examples cannot work
> out how I woudl represent this, or whether I need to create an element
> that actually models this.
MT>> As far as I can see you would need to model a separate element to accomplish. Let me know if
you come to another conclusion.

>
> A couple of small things I noticed too.
>
> eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
> is used int he examples, this no longer exist is and I cannot find it. I
> wanted to see the full set of XMLType values.
MT>> I am not 100% sure if you mean this but the xml types are all in the XMLType package:
org.eclipse.emf.ecore.xml.type.XMLTypePackage and its impl. class.

>
> A more general thing, I worked on a project (dentaku at codehaus.org)
> where we use stereotypes and tagged values in the UML to specify column
> types and lengths etc. Then generated the Hibernate file from that. With
> ECore there does not seem to be a way to do this so you end up with a
> messy process, UML model then hand edit the ECore created from it to add
> teneo.jap annotations. Any way of improving this?
MT>> See my answer below regarding setting annotations outside of the ecore.

Regarding specifying column types/lengths on another level than specific eattributes/ereferences,
Teneo supports annotations (for column types/lengths) on EDataTypes. Then each EAttribute which uses
this EDataType will automatically get these annotations applied. I would also like something similar
for EReference but there is no EDataType for EReferences in ecore. Maybe Ed can comment in more
detail on this.

Regarding stereotypes and emf there are a number of posts related to this topic on the emf newsgroup
(search for stereotype in the header). I am not sure if newer versions of EMF have some sort of
automatic stereotype to eannotation mapping.
If so it could be an idea to allow tagging modelelements with a stereotype/eannotation and then
allow specification of jpa annotations on this tag level. If this sounds interesting then please
open a bugzilla so that it gets on the to-do list (and we can discuss it there).

> A second difficulty is
> that with large XSDs produced as part of a standard it would be nice if
> you could have the teneo.jpa annotations in a separate file so that when
> a new version of that standard is released it is easier to manage the
> changes, the only way to automate this I can see now is to write a mega
> XSLT script to merge two files to add the teneo annotations to the
> standard XSD.
MT>> Teneo also allows you to set annotations in a separate xml (actually my prefered way of working):
http://www.elver.org/hibernate/ejb3_format.html#xml
So then you don't need to edit the ecore.
Is this what you mean?

>
> Thx.
>
> David


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] 3 way join, how to do? [message #615617 is a reply to message #113984] Thu, 06 March 2008 13:03 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi David,
See my comments inline.

gr. Martin

david wrote:
> Hi,
>
> I am adapting a security service to use Teneo as the persistance layer.
> The original system had a Role table, a Group table, a Permission table
> and a User table. There was a table to join the Group, User and Role
> information together. e.g. USER_GROUP_ROLE primary key (USER_ID,
> GROUP_ID, ROLE_ID).
>
> I am using the teneo.jpa annotations but from the examples cannot work
> out how I woudl represent this, or whether I need to create an element
> that actually models this.
MT>> As far as I can see you would need to model a separate element to accomplish. Let me know if
you come to another conclusion.

>
> A couple of small things I noticed too.
>
> eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"
> is used int he examples, this no longer exist is and I cannot find it. I
> wanted to see the full set of XMLType values.
MT>> I am not 100% sure if you mean this but the xml types are all in the XMLType package:
org.eclipse.emf.ecore.xml.type.XMLTypePackage and its impl. class.

>
> A more general thing, I worked on a project (dentaku at codehaus.org)
> where we use stereotypes and tagged values in the UML to specify column
> types and lengths etc. Then generated the Hibernate file from that. With
> ECore there does not seem to be a way to do this so you end up with a
> messy process, UML model then hand edit the ECore created from it to add
> teneo.jap annotations. Any way of improving this?
MT>> See my answer below regarding setting annotations outside of the ecore.

Regarding specifying column types/lengths on another level than specific eattributes/ereferences,
Teneo supports annotations (for column types/lengths) on EDataTypes. Then each EAttribute which uses
this EDataType will automatically get these annotations applied. I would also like something similar
for EReference but there is no EDataType for EReferences in ecore. Maybe Ed can comment in more
detail on this.

Regarding stereotypes and emf there are a number of posts related to this topic on the emf newsgroup
(search for stereotype in the header). I am not sure if newer versions of EMF have some sort of
automatic stereotype to eannotation mapping.
If so it could be an idea to allow tagging modelelements with a stereotype/eannotation and then
allow specification of jpa annotations on this tag level. If this sounds interesting then please
open a bugzilla so that it gets on the to-do list (and we can discuss it there).

> A second difficulty is
> that with large XSDs produced as part of a standard it would be nice if
> you could have the teneo.jpa annotations in a separate file so that when
> a new version of that standard is released it is easier to manage the
> changes, the only way to automate this I can see now is to write a mega
> XSLT script to merge two files to add the teneo annotations to the
> standard XSD.
MT>> Teneo also allows you to set annotations in a separate xml (actually my prefered way of working):
http://www.elver.org/hibernate/ejb3_format.html#xml
So then you don't need to edit the ecore.
Is this what you mean?

>
> Thx.
>
> David


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:[Teneo] 3 way join, how to do?
Next Topic:teneo: same name problem using jpox
Goto Forum:
  


Current Time: Sun Jun 13 12:25:27 GMT 2021

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

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

Back to the top