|
Re: [Teneo] Multi-column join? [message #106835 is a reply to message #106805] |
Tue, 15 January 2008 06:08 |
Martin Taal 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({
	@JoinColumn(name="m yParentFirstName", referencedColumnName="firstName"),
 ;	@JoinColumn(name="myParentLastName&qu ot;, referencedColumnName="lastName"),
 }) "/>
</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 #613986 is a reply to message #106805] |
Tue, 15 January 2008 06:08 |
Martin Taal 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({
	@JoinColumn(name="m yParentFirstName", referencedColumnName="firstName"),
 ;	@JoinColumn(name="myParentLastName&qu ot;, referencedColumnName="lastName"),
 }) "/>
</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--
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03655 seconds