Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Multi-column join?
[Teneo] Multi-column join? [message #106805] Mon, 14 January 2008 23:47 Go to next message
Jason Henriksen is currently offline Jason HenriksenFriend
Messages: 231
Registered: July 2009
Senior Member
I haven't updated my version of Teneo in a while. My client has decided
that they really need to support of horribly written old tables and now
they're coming up to a multi-column join problem.

We looked into the code, it looks like the multiple column join is
specifically not supported. Do you know if it would be very hard to add
support for it? Any suggestions about what would need to be done to
support it. (I.E. is it something I could do myself relatively quickly?)

Thanks for any advice,

Jason

---------------------------------------------

public class ManyToOneMapper
extends AbstractAssociationMapper
implements ExtensionPoint {

public void process(PAnnotatedEReference paReference) {
log.debug("Process many-to-one " + paReference);

final List<JoinColumn> jcs = getJoinColumns(paReference);
if (jcs.size() > 1) { // TODO support multiple join columns
log.error("Unsupported multiple join columns in " + paReference);
throw new MappingException("Unsupported multiple join columns",
paReference);
}
..
..
..
Re: [Teneo] Multi-column join? [message #106835 is a reply to message #106805] Tue, 15 January 2008 06:08 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090904020207090004090706
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jason,
I have a testcase which shows support for composite ids and multiple join columns (see the attached
ecore and then the children collection in parent).

Or do you mean something else?

gr. Martin

jason henriksen wrote:
>
> I haven't updated my version of Teneo in a while. My client has decided
> that they really need to support of horribly written old tables and now
> they're coming up to a multi-column join problem.
>
> We looked into the code, it looks like the multiple column join is
> specifically not supported. Do you know if it would be very hard to add
> support for it? Any suggestions about what would need to be done to
> support it. (I.E. is it something I could do myself relatively quickly?)
>
> Thanks for any advice,
>
> Jason
>
> ---------------------------------------------
>
> public class ManyToOneMapper
> extends AbstractAssociationMapper
> implements ExtensionPoint {
>
> public void process(PAnnotatedEReference paReference) {
> log.debug("Process many-to-one " + paReference);
>
> final List<JoinColumn> jcs = getJoinColumns(paReference);
> if (jcs.size() > 1) { // TODO support multiple join columns
> log.error("Unsupported multiple join columns in " + paReference);
> throw new MappingException("Unsupported multiple join columns",
> paReference);
> }
> ..
> ..
> ..
>


--

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

--------------090904020207090004090706
Content-Type: text/xml;
name="compositeid.ecore"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="compositeid.ecore"

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="compositeid"
nsURI="http:///org/elver/samples/emf/annotations/compositeid.ecore" nsPrefix="org.eclipse.emf.teneo.samples.emf.annotations.compositeid ">
<eClassifiers xsi:type="ecore:EClass" name="Parent" eSuperTypes="#//Person">
<eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
eType="#//Child">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value=" @JoinColumns({&#xA;&#x9;@JoinColumn(name=&quot;m yParentFirstName&quot;, referencedColumnName=&quot;firstName&quot;),&#xA ;&#x9;@JoinColumn(name=&quot;myParentLastName&qu ot;, referencedColumnName=&quot;lastName&quot;),&#xA; }) "/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Child" eSuperTypes="#//Person"/>
<eClassifiers xsi:type="ecore:EClass" name="Person">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value=" @IdClass(org.eclipse.emf.teneo.samples.emf.annotations.compo siteid.PersonID) "/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="firstName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Id"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="lastName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Id"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>

--------------090904020207090004090706--
Re: [Teneo] Multi-column join? [message #107581 is a reply to message #106835] Thu, 17 January 2008 19:34 Go to previous messageGo to next message
Jason Henriksen is currently offline Jason HenriksenFriend
Messages: 231
Registered: July 2009
Senior Member
Just heads up that I added those XSDs to the bug,

Jason
Re: [Teneo] Multi-column join? [message #107608 is a reply to message #107581] Thu, 17 January 2008 23:28 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Okay thanks, I will check in the solution early tomorrow morning (netherlands timezone).

gr. Martin

jason henriksen wrote:
> Just heads up that I added those XSDs to the bug,
>
> Jason


--

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] Multi-column join? [message #107621 is a reply to message #107608] Fri, 18 January 2008 06:30 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Jason,
Check in has been done. You should do a cvs update for most projects as I also cleaned up an
internal api which resulted in a number of smaller changes in various locations.
I have added a description of the solution in the bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=215635

This description will be added to the docs also.

gr. Martin

Martin Taal wrote:
> Okay thanks, I will check in the solution early tomorrow morning
> (netherlands timezone).
>
> gr. Martin
>
> jason henriksen wrote:
>> Just heads up that I added those XSDs to the bug,
>>
>> Jason
>
>


--

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] Multi-column join? [message #613986 is a reply to message #106805] Tue, 15 January 2008 06:08 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090904020207090004090706
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jason,
I have a testcase which shows support for composite ids and multiple join columns (see the attached
ecore and then the children collection in parent).

Or do you mean something else?

gr. Martin

jason henriksen wrote:
>
> I haven't updated my version of Teneo in a while. My client has decided
> that they really need to support of horribly written old tables and now
> they're coming up to a multi-column join problem.
>
> We looked into the code, it looks like the multiple column join is
> specifically not supported. Do you know if it would be very hard to add
> support for it? Any suggestions about what would need to be done to
> support it. (I.E. is it something I could do myself relatively quickly?)
>
> Thanks for any advice,
>
> Jason
>
> ---------------------------------------------
>
> public class ManyToOneMapper
> extends AbstractAssociationMapper
> implements ExtensionPoint {
>
> public void process(PAnnotatedEReference paReference) {
> log.debug("Process many-to-one " + paReference);
>
> final List<JoinColumn> jcs = getJoinColumns(paReference);
> if (jcs.size() > 1) { // TODO support multiple join columns
> log.error("Unsupported multiple join columns in " + paReference);
> throw new MappingException("Unsupported multiple join columns",
> paReference);
> }
> ..
> ..
> ..
>


--

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

--------------090904020207090004090706
Content-Type: text/xml;
name="compositeid.ecore"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="compositeid.ecore"

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="compositeid"
nsURI="http:///org/elver/samples/emf/annotations/compositeid.ecore" nsPrefix="org.eclipse.emf.teneo.samples.emf.annotations.compositeid ">
<eClassifiers xsi:type="ecore:EClass" name="Parent" eSuperTypes="#//Person">
<eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
eType="#//Child">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value=" @JoinColumns({&#xA;&#x9;@JoinColumn(name=&quot;m yParentFirstName&quot;, referencedColumnName=&quot;firstName&quot;),&#xA ;&#x9;@JoinColumn(name=&quot;myParentLastName&qu ot;, referencedColumnName=&quot;lastName&quot;),&#xA; }) "/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Child" eSuperTypes="#//Person"/>
<eClassifiers xsi:type="ecore:EClass" name="Person">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value=" @IdClass(org.eclipse.emf.teneo.samples.emf.annotations.compo siteid.PersonID) "/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="firstName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Id"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="lastName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="teneo.jpa">
<details key="appinfo" value="@Id"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>

--------------090904020207090004090706--
Re: [Teneo] Multi-column join? [message #614040 is a reply to message #106835] Thu, 17 January 2008 19:34 Go to previous message
Jason Henriksen is currently offline Jason HenriksenFriend
Messages: 231
Registered: July 2009
Senior Member
Just heads up that I added those XSDs to the bug,

Jason
Re: [Teneo] Multi-column join? [message #614042 is a reply to message #107581] Thu, 17 January 2008 23:28 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Okay thanks, I will check in the solution early tomorrow morning (netherlands timezone).

gr. Martin

jason henriksen wrote:
> Just heads up that I added those XSDs to the bug,
>
> Jason


--

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] Multi-column join? [message #614043 is a reply to message #107608] Fri, 18 January 2008 06:30 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Jason,
Check in has been done. You should do a cvs update for most projects as I also cleaned up an
internal api which resulted in a number of smaller changes in various locations.
I have added a description of the solution in the bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=215635

This description will be added to the docs also.

gr. Martin

Martin Taal wrote:
> Okay thanks, I will check in the solution early tomorrow morning
> (netherlands timezone).
>
> gr. Martin
>
> jason henriksen wrote:
>> Just heads up that I added those XSDs to the bug,
>>
>> Jason
>
>


--

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:[CDO][0.8.0] CDORevision List - should have a better implementation for UNINITIALIZED data.
Next Topic:Bug in TENEO 0.8.0.v2007.12.28.0940
Goto Forum:
  


Current Time: Thu Apr 18 17:38:16 GMT 2024

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

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

Back to the top