Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » [TENEO] Sequence generation problem
|
Re: [TENEO] Sequence generation problem [message #92774 is a reply to message #92759] |
Wed, 08 August 2007 19:18 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------080508020903000407070303
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi Jason,
Afair sequence generators need to be defined on package level, in xsd this means just below the
xsd:schema element.
See the attachment for an example of one of the testcases.
gr. Martin
Jason Henriksen wrote:
> Hi All,
>
> Am I doing this wrong? I need my object to use a pre-existing sequence, but
> I get this exception:
>
> Caused by: java.lang.IllegalStateException: No sequence generator found with
> the name: SEQ_CMR3605T, name is used in annotation of element
> Address/addressSK
>
> The XSD I'm using looks like this (taken from a JPA annotation reference)
>
> <xsd:element name="addressSK" type="xsd:int">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Id
> @Column(name="ADDRESS_SK" nullable="false")
> @SequenceGenerator(name="SEQ_CMR3605T", sequenceName="SEQ_CMR3605T",
> allocationSize=1)
> @GeneratedValue(strategy=SEQUENCE, generator="SEQ_CMR3605T")
> </xsd:appinfo>
> <xsd:documentation>A generated key to uniquely the
> record.</xsd:documentation>
> </xsd:annotation>
> </xsd:element>
>
>
> Here's the stack trace:
>
> Caused by: java.lang.IllegalStateException: No sequence generator found with
> the name: SEQ_CMR3605T, name is used in annotation of element
> Address/addressSK
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getSequen
> ceGenerator(PAnnotatedModelImpl.java:462)
> at
> org.eclipse.emf.teneo.hibernate.mapper.IdMapper.processIdPro perty(IdMapper.j
> ava:257)
> at
> org.eclipse.emf.teneo.hibernate.mapper.FeatureMapper.process PAnnotatedEAttri
> bute(FeatureMapper.java:125)
> at
> org.eclipse.emf.teneo.hibernate.mapper.FeatureMapper.process (FeatureMapper.j
> ava:98)
> at
> org.eclipse.emf.teneo.hibernate.mapper.EntityMapper.processF eature(EntityMap
> per.java:490)
> at
> org.eclipse.emf.teneo.hibernate.mapper.EntityMapper.processF eatures(EntityMa
> pper.java:390)
> at
> org.eclipse.emf.teneo.hibernate.mapper.EntityMapper.processE ntity(EntityMapp
> er.java:277)
> at
> org.eclipse.emf.teneo.hibernate.mapper.HibernateMappingGener ator.processPACl
> ass(HibernateMappingGenerator.java:183)
> at
> org.eclipse.emf.teneo.hibernate.mapper.HibernateMappingGener ator.processPers
> istentClasses(HibernateMappingGenerator.java:151)
> at
> org.eclipse.emf.teneo.hibernate.mapper.HibernateMappingGener ator.generate(Hi
> bernateMappingGenerator.java:113)
> at
> org.eclipse.emf.teneo.hibernate.mapper.HibernateMappingGener ator.generateToS
> tring(HibernateMappingGenerator.java:124)
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:55
> 1)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataSto
> re.java:163)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataS
> tore.java:77)
>
>
> (Warning: The line numbers may not line up due to some local hacking, but I
> haven't touched anything to do with sequences)
>
>
>
> 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
--------------080508020903000407070303
Content-Type: text/xml;
name="id.xsd"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="id.xsd"
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/hb/ generator/id"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:lib=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/hb/ generator/id"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:appinfo source="teneo.hibernate">
@GenericGenerator(name="system-uuid", strategy = "uuid")
@GenericGenerator(name="hibseq", strategy = "hilo",
parameters = {
@Parameter(name="table", value = "hilo_table"),
@Parameter(name="column", value="the_hilo_column")
}
)
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType name="SimpleID">
<xsd:sequence>
<xsd:element name="autoID" type="xsd:long">
<xsd:annotation>
<xsd:appinfo source="teneo.hibernate">
@Id @GeneratedValue
@Column(name="AUTOD" nullable="false")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="generated" type="xsd:long">
<xsd:annotation>
<xsd:appinfo source="teneo.hibernate">
@Generated(ALWAYS)
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="TableID">
<xsd:sequence>
<xsd:element name="myid" type="xsd:long">
<xsd:annotation>
<xsd:appinfo source="teneo.hibernate">
@Id @GeneratedValue(generator="hibseq")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IdentityID">
<xsd:sequence>
<xsd:element name="myid" type="xsd:long">
<xsd:annotation>
<xsd:appinfo source="teneo.hibernate">
@Id @GeneratedValue(strategy="IDENTITY")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
--------------080508020903000407070303--
|
|
|
Re: [TENEO] Sequence generation problem [message #92789 is a reply to message #92774] |
Wed, 08 August 2007 22:09 |
Jason Henriksen Messages: 231 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_005B_01C7D9CE.2C0D54B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Martin,
I'm still getting:
2007/08/08 15:02:32:047 PDT [ERROR] AnnotationParserException - The =
eclass: HbAnnotatedEClass does not have an efeature for GenericGenerator =
< org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption: The =
eclass: HbAnnotatedEClass does not have an efeature for =
GenericGenerator>org.eclipse.emf.teneo.annotations.parser.AnnotationParse=
rException: The eclass: HbAnnotatedEClass does not have an efeature for =
GenericGenerator
at =
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
sAnnotatedModelElement(EAnnotationParserImporter.java:130)
at =
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
s(EAnnotationParserImporter.java:71)
at =
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
s(EAnnotationParserImporter.java:64)
at =
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildM=
apping(PersistenceMappingBuilder.java:94)
at =
org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java=
:548)
at =
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionData=
Store.java:163)
at =
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDa=
taStore.java:77)
at com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 )
at com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)
After following your advice and making my code look like this:
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<xsd:schema=20
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"=20
xmlns:ecore=3D"http://www.eclipse.org/emf/2002/Ecore"=20
xmlns:vsp=3D"http://vsp.com/"=20
targetNamespace=3D"http://vsp.com/">
=20
<xsd:annotation><xsd:appinfo source=3D"teneo.hibernate">
@GenericGenerator(
name =3D "SEQ_CMR3601T",
strategy =3D "sequence"
parameters=3D {
@Parameter(name =3D "sequence-name", value =3D =
"SEQ_CMR3601T")
}
)
</xsd:appinfo></xsd:annotation>
=20
=20
<xsd:complexType name=3D"Consumer">
<xsd:sequence>
<xsd:element default=3D"0" name=3D"consumerSK" type=3D"xsd:int">
<xsd:annotation>
<xsd:appinfo source=3D"teneo.jpa">
@Column(name=3DCONSUMER_SK nullable=3D"false")
@Id
@GeneratedValue(generator=3D"SEQ_CMR3601T") =
=20
</xsd:appinfo>
=20
<xsd:documentation>A generated key to uniquely identify =
a person</xsd:documentation>
</xsd:annotation>
</xsd:element>
Could it be that the first annotation is teneo.hibernate while the =
second annotation is teneo.jpa?
(I've used exclusively teneo.jpa thus far). =20
I'm also wondering if you have an example where the strategy is =
'sequence'. Maybe I'm not setting the sequence name properly?
Like I say, I can't generate the sequence, I have to use the one =
provided by the DBA, but finding an example of this being done using =
annotations has proven difficult.
Thanks for any suggestions,
Jason Henriksen
------=_NextPart_000_005B_01C7D9CE.2C0D54B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1561" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff background=3D"">
<DIV><FONT face=3DArial size=3D2>Hi Martin,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'm still getting:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>2007/08/08 15:02:32:047 PDT [ERROR]=20
AnnotationParserException - The eclass: HbAnnotatedEClass does not have =
an=20
efeature for GenericGenerator=20
<org.eclipse.emf.teneo.annotations.parser.AnnotationP arserException: =
The=20
eclass: HbAnnotatedEClass does not have an efeature for=20
GenericGenerator>org.eclipse.emf.teneo.annotations.pa rser.AnnotationPa=
rserException:=20
The eclass: HbAnnotatedEClass does not have an efeature for=20
GenericGenerator<BR> at=20
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
sAnnotatedModelElement(EAnnotationParserImporter.java:130)<BR > at=20
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
s(EAnnotationParserImporter.java:71)<BR> at=20
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
s(EAnnotationParserImporter.java:64)<BR> at=20
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildM=
apping(PersistenceMappingBuilder.java:94)<BR> at=20
org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java=
:548)<BR> at=20
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionData=
Store.java:163)<BR> at=20
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDa=
taStore.java:77)<BR> at=20
com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 ) <BR> at=
=20
com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)</FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>After following your advice and making =
my code look=20
like this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT size=3D2><FONT face=3DCourier><?xml version=3D"1.0"=20
encoding=3D"UTF-8"?><BR><xsd:schema </FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT face=3DCourier>xmlns:xsd=3D"</FONT><A=20
href=3D"http://www.w3.org/2001/XMLSchema"><FONT=20
face=3DCourier>http://www.w3.org/2001/XMLSchema</FONT></A><FONT =
face=3DCourier>"=20
</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT face=3DCourier>xmlns:ecore=3D"</FONT><A=20
href=3D"http://www.eclipse.org/emf/2002/Ecore"><FONT=20
face=3DCourier>http://www.eclipse.org/emf/2002/Ecore</FONT></A><FONT=20
face=3DCourier>" </FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT face=3DCourier>xmlns:vsp=3D"</FONT><A=20
href=3D"http://vsp.com/"><FONT =
face=3DCourier>http://vsp.com/</FONT></A><FONT=20
face=3DCourier>" </FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT face=3DCourier>targetNamespace=3D"</FONT><A=20
href=3D"http://vsp.com/"><FONT =
face=3DCourier>http://vsp.com/</FONT></A><FONT=20
face=3DCourier>"><BR> <BR> =20
<xsd:annotation><xsd:appinfo=20
source=3D"teneo.hibernate"><BR> =20
@GenericGenerator(<BR> name =
=3D=20
"SEQ_CMR3601T",<BR> strategy =
=3D=20
"sequence"<BR> parameters=3D=20
{<BR> =20
@Parameter(name =3D "sequence-name", value =3D=20
"SEQ_CMR3601T")<BR> =20
}<BR> )<BR> =20
</xsd:appinfo></xsd:annotation><BR > =20
<BR> <BR> <xsd:complexType=20
name=3D"Consumer"><BR> =20
<xsd:sequence><BR> <xsd:element=20
default=3D"0" name=3D"consumerSK"=20
type=3D"xsd:int"><BR> &=
nbsp; =20
<xsd:annotation><BR>  =
;   ; =20
<xsd:appinfo=20
source=3D"teneo.jpa"><BR> &nb=
sp; &nb sp; =20
@Column(name=3DCONSUMER_SK=20
nullable=3D"false")<BR> &n=
bsp; &n bsp;=20
@Id<BR> =
=20
@GeneratedValue(generator=3D"SEQ_CMR3601T") =
=20
<BR> &nb=
sp; =20
</xsd:appinfo><BR> &=
nbsp; & nbsp;=20
<BR> &nb=
sp; =20
<xsd:documentation>A generated key to uniquely identify a=20
person</xsd:documentation><BR> &=
nbsp; =20
</xsd:annotation><BR> =20
</xsd:element></FONT></FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Could it be that the first annotation =
is=20
teneo.hibernate while the second annotation is teneo.jpa?<BR>(I've used=20
exclusively teneo.jpa thus far). </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'm also wondering if you have an =
example where the=20
strategy is 'sequence'. Maybe I'm not setting the sequence name=20
properly?<BR>Like I say, I can't generate the sequence, I have to use =
the one=20
provided by the DBA, but finding an example of this being done using =
annotations=20
has proven difficult.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for any =
suggestions,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2> &nbs=
p; =20
Jason=20
Henriksen<BR> =
=20
</FONT></DIV></BODY></HTML>
------=_NextPart_000_005B_01C7D9CE.2C0D54B0--
|
|
|
Re: [TENEO] Sequence generation problem [message #92804 is a reply to message #92789] |
Wed, 08 August 2007 22:25 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Jason,
With my testcase the annotation in the top of the xsd gets translated to an annotation of the
epackage. This is how it should be. It seems that with you it gets translated to an annotation on an
EClass. Can you check in your ecore (or post that relevant part)?
gr. Martin
Jason Henriksen wrote:
> Hi Martin,
>
> I'm still getting:
>
> 2007/08/08 15:02:32:047 PDT [ERROR] AnnotationParserException - The
> eclass: HbAnnotatedEClass does not have an efeature for GenericGenerator
> < org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption: The
> eclass: HbAnnotatedEClass does not have an efeature for
> GenericGenerator> org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption:
> The eclass: HbAnnotatedEClass does not have an efeature for GenericGenerator
> at
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.processAnnotatedModelElement(EAnnotationParserImporte r.java:130)
> at
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(EAnnotationParserImporter.java:71)
> at
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(EAnnotationParserImporter.java:64)
> at
> org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:94)
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:548)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:163)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:77)
> at com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 )
> at com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)
>
> After following your advice and making my code look like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:vsp="http://vsp.com/"
> targetNamespace="http://vsp.com/">
>
> <xsd:annotation><xsd:appinfo source="teneo.hibernate">
> @GenericGenerator(
> name = "SEQ_CMR3601T",
> strategy = "sequence"
> parameters= {
> @Parameter(name = "sequence-name", value = "SEQ_CMR3601T")
> }
> )
> </xsd:appinfo></xsd:annotation>
>
>
> <xsd:complexType name="Consumer">
> <xsd:sequence>
> <xsd:element default="0" name="consumerSK" type="xsd:int">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Column(name=CONSUMER_SK nullable="false")
> @Id
> @GeneratedValue(generator="SEQ_CMR3601T")
> </xsd:appinfo>
>
> <xsd:documentation>A generated key to uniquely identify
> a person</xsd:documentation>
> </xsd:annotation>
> </xsd:element>
>
>
> Could it be that the first annotation is teneo.hibernate while the
> second annotation is teneo.jpa?
> (I've used exclusively teneo.jpa thus far).
>
> I'm also wondering if you have an example where the strategy is
> 'sequence'. Maybe I'm not setting the sequence name properly?
> Like I say, I can't generate the sequence, I have to use the one
> provided by the DBA, but finding an example of this being done using
> annotations has proven difficult.
>
> Thanks for any suggestions,
>
> Jason Henriksen
>
--
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] Sequence generation problem [message #92819 is a reply to message #92804] |
Wed, 08 August 2007 22:57 |
Jason Henriksen Messages: 231 Registered: July 2009 |
Senior Member |
|
|
Hi Martin,
Here are all the pieces in full.
Thanks or any help,
Jason
"Martin Taal" <mtaal@elver.org> wrote in message
news:f9dfta$92j$1@build.eclipse.org...
> Hi Jason,
> With my testcase the annotation in the top of the xsd gets translated to
an annotation of the
> epackage. This is how it should be. It seems that with you it gets
translated to an annotation on an
> EClass. Can you check in your ecore (or post that relevant part)?
>
> gr. Martin
>
> Jason Henriksen wrote:
> > Hi Martin,
> >
> > I'm still getting:
> >
> > 2007/08/08 15:02:32:047 PDT [ERROR] AnnotationParserException - The
> > eclass: HbAnnotatedEClass does not have an efeature for GenericGenerator
> > < org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption: The
> > eclass: HbAnnotatedEClass does not have an efeature for
> >
GenericGenerator>org.eclipse.emf.teneo.annotations.parser.AnnotationParserEx
ception:
> > The eclass: HbAnnotatedEClass does not have an efeature for
GenericGenerator
> > at
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.processAn
notatedModelElement(EAnnotationParserImporter.java:130)
> > at
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
AnnotationParserImporter.java:71)
> > at
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
AnnotationParserImporter.java:64)
> > at
> >
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapp
ing(PersistenceMappingBuilder.java:94)
> > at
> >
org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:54
8)
> > at
> >
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataSto
re.java:163)
> > at
> >
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataS
tore.java:77)
> > at com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 )
> > at com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)
> >
> > After following your advice and making my code look like this:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsd:schema
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> > xmlns:vsp="http://vsp.com/"
> > targetNamespace="http://vsp.com/">
> >
> > <xsd:annotation><xsd:appinfo source="teneo.hibernate">
> > @GenericGenerator(
> > name = "SEQ_CMR3601T",
> > strategy = "sequence"
> > parameters= {
> > @Parameter(name = "sequence-name", value = "SEQ_CMR3601T")
> > }
> > )
> > </xsd:appinfo></xsd:annotation>
> >
> >
> > <xsd:complexType name="Consumer">
> > <xsd:sequence>
> > <xsd:element default="0" name="consumerSK" type="xsd:int">
> > <xsd:annotation>
> > <xsd:appinfo source="teneo.jpa">
> > @Column(name=CONSUMER_SK nullable="false")
> > @Id
> > @GeneratedValue(generator="SEQ_CMR3601T")
> > </xsd:appinfo>
> >
> > <xsd:documentation>A generated key to uniquely identify
> > a person</xsd:documentation>
> > </xsd:annotation>
> > </xsd:element>
> >
> >
> > Could it be that the first annotation is teneo.hibernate while the
> > second annotation is teneo.jpa?
> > (I've used exclusively teneo.jpa thus far).
> >
> > I'm also wondering if you have an example where the strategy is
> > 'sequence'. Maybe I'm not setting the sequence name properly?
> > Like I say, I can't generate the sequence, I have to use the one
> > provided by the DBA, but finding an example of this being done using
> > annotations has proven difficult.
> >
> > Thanks for any suggestions,
> >
> > Jason Henriksen
> >
>
>
> --
>
> 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] Sequence generation problem [message #92838 is a reply to message #92819] |
Thu, 09 August 2007 03:28 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Jason,
The @GenericGenerator is currently not supported at the EClass level only at package level. In your
model (customer.ecore) I can see that there are GenericGenerator annotations in the Address,
EmailType, Member and Phone EClasses. These should all be moved to the package level. Having
multiple GenericGenerator annotations at package level should work.
Hibernate annotations allows genericgenerator annotations on class level also. So Teneo should also
support this. Can you enter a bugzilla for this?
gr. Martin
Jason Henriksen wrote:
> Hi Martin,
>
> Here are all the pieces in full.
>
> Thanks or any help,
>
> Jason
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:f9dfta$92j$1@build.eclipse.org...
>> Hi Jason,
>> With my testcase the annotation in the top of the xsd gets translated to
> an annotation of the
>> epackage. This is how it should be. It seems that with you it gets
> translated to an annotation on an
>> EClass. Can you check in your ecore (or post that relevant part)?
>>
>> gr. Martin
>>
>> Jason Henriksen wrote:
>>> Hi Martin,
>>>
>>> I'm still getting:
>>>
>>> 2007/08/08 15:02:32:047 PDT [ERROR] AnnotationParserException - The
>>> eclass: HbAnnotatedEClass does not have an efeature for GenericGenerator
>>> < org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption: The
>>> eclass: HbAnnotatedEClass does not have an efeature for
>>>
> GenericGenerator>org.eclipse.emf.teneo.annotations.parser.AnnotationParserEx
> ception:
>>> The eclass: HbAnnotatedEClass does not have an efeature for
> GenericGenerator
>>> at
>>>
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.processAn
> notatedModelElement(EAnnotationParserImporter.java:130)
>>> at
>>>
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
> AnnotationParserImporter.java:71)
>>> at
>>>
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
> AnnotationParserImporter.java:64)
>>> at
>>>
> org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapp
> ing(PersistenceMappingBuilder.java:94)
>>> at
>>>
> org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:54
> 8)
>>> at
>>>
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataSto
> re.java:163)
>>> at
>>>
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataS
> tore.java:77)
>>> at com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 )
>>> at com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)
>>>
>>> After following your advice and making my code look like this:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <xsd:schema
>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>>> xmlns:vsp="http://vsp.com/"
>>> targetNamespace="http://vsp.com/">
>>>
>>> <xsd:annotation><xsd:appinfo source="teneo.hibernate">
>>> @GenericGenerator(
>>> name = "SEQ_CMR3601T",
>>> strategy = "sequence"
>>> parameters= {
>>> @Parameter(name = "sequence-name", value = "SEQ_CMR3601T")
>>> }
>>> )
>>> </xsd:appinfo></xsd:annotation>
>>>
>>>
>>> <xsd:complexType name="Consumer">
>>> <xsd:sequence>
>>> <xsd:element default="0" name="consumerSK" type="xsd:int">
>>> <xsd:annotation>
>>> <xsd:appinfo source="teneo.jpa">
>>> @Column(name=CONSUMER_SK nullable="false")
>>> @Id
>>> @GeneratedValue(generator="SEQ_CMR3601T")
>>> </xsd:appinfo>
>>>
>>> <xsd:documentation>A generated key to uniquely identify
>>> a person</xsd:documentation>
>>> </xsd:annotation>
>>> </xsd:element>
>>>
>>>
>>> Could it be that the first annotation is teneo.hibernate while the
>>> second annotation is teneo.jpa?
>>> (I've used exclusively teneo.jpa thus far).
>>>
>>> I'm also wondering if you have an example where the strategy is
>>> 'sequence'. Maybe I'm not setting the sequence name properly?
>>> Like I say, I can't generate the sequence, I have to use the one
>>> provided by the DBA, but finding an example of this being done using
>>> annotations has proven difficult.
>>>
>>> Thanks for any suggestions,
>>>
>>> Jason Henriksen
>>>
>>
>> --
>>
>> 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
>
>
--
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] Sequence generation problem [message #92902 is a reply to message #92838] |
Thu, 09 August 2007 16:33 |
Jason Henriksen Messages: 231 Registered: July 2009 |
Senior Member |
|
|
No problem Martin.
I should have moved them all up. I only moved Consumer up thinking I could
test that seperately, but I guess the non-Consumer classes were still
causing a problem.
I'll get that bugzilla entry in today.
Jason Henriksen
"Martin Taal" <mtaal@elver.org> wrote in message
news:f9e1lm$2at$1@build.eclipse.org...
> Hi Jason,
> The @GenericGenerator is currently not supported at the EClass level only
at package level. In your
> model (customer.ecore) I can see that there are GenericGenerator
annotations in the Address,
> EmailType, Member and Phone EClasses. These should all be moved to the
package level. Having
> multiple GenericGenerator annotations at package level should work.
>
> Hibernate annotations allows genericgenerator annotations on class level
also. So Teneo should also
> support this. Can you enter a bugzilla for this?
>
> gr. Martin
>
> Jason Henriksen wrote:
> > Hi Martin,
> >
> > Here are all the pieces in full.
> >
> > Thanks or any help,
> >
> > Jason
> >
> > "Martin Taal" <mtaal@elver.org> wrote in message
> > news:f9dfta$92j$1@build.eclipse.org...
> >> Hi Jason,
> >> With my testcase the annotation in the top of the xsd gets translated
to
> > an annotation of the
> >> epackage. This is how it should be. It seems that with you it gets
> > translated to an annotation on an
> >> EClass. Can you check in your ecore (or post that relevant part)?
> >>
> >> gr. Martin
> >>
> >> Jason Henriksen wrote:
> >>> Hi Martin,
> >>>
> >>> I'm still getting:
> >>>
> >>> 2007/08/08 15:02:32:047 PDT [ERROR] AnnotationParserException - The
> >>> eclass: HbAnnotatedEClass does not have an efeature for
GenericGenerator
> >>> < org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption:
The
> >>> eclass: HbAnnotatedEClass does not have an efeature for
> >>>
> >
GenericGenerator>org.eclipse.emf.teneo.annotations.parser.AnnotationParserEx
> > ception:
> >>> The eclass: HbAnnotatedEClass does not have an efeature for
> > GenericGenerator
> >>> at
> >>>
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.processAn
> > notatedModelElement(EAnnotationParserImporter.java:130)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
> > AnnotationParserImporter.java:71)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
> > AnnotationParserImporter.java:64)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapp
> > ing(PersistenceMappingBuilder.java:94)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:54
> > 8)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataSto
> > re.java:163)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataS
> > tore.java:77)
> >>> at com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 )
> >>> at com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)
> >>>
> >>> After following your advice and making my code look like this:
> >>>
> >>> <?xml version="1.0" encoding="UTF-8"?>
> >>> <xsd:schema
> >>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> >>> xmlns:vsp="http://vsp.com/"
> >>> targetNamespace="http://vsp.com/">
> >>>
> >>> <xsd:annotation><xsd:appinfo source="teneo.hibernate">
> >>> @GenericGenerator(
> >>> name = "SEQ_CMR3601T",
> >>> strategy = "sequence"
> >>> parameters= {
> >>> @Parameter(name = "sequence-name", value = "SEQ_CMR3601T")
> >>> }
> >>> )
> >>> </xsd:appinfo></xsd:annotation>
> >>>
> >>>
> >>> <xsd:complexType name="Consumer">
> >>> <xsd:sequence>
> >>> <xsd:element default="0" name="consumerSK" type="xsd:int">
> >>> <xsd:annotation>
> >>> <xsd:appinfo source="teneo.jpa">
> >>> @Column(name=CONSUMER_SK nullable="false")
> >>> @Id
> >>> @GeneratedValue(generator="SEQ_CMR3601T")
> >>> </xsd:appinfo>
> >>>
> >>> <xsd:documentation>A generated key to uniquely
identify
> >>> a person</xsd:documentation>
> >>> </xsd:annotation>
> >>> </xsd:element>
> >>>
> >>>
> >>> Could it be that the first annotation is teneo.hibernate while the
> >>> second annotation is teneo.jpa?
> >>> (I've used exclusively teneo.jpa thus far).
> >>>
> >>> I'm also wondering if you have an example where the strategy is
> >>> 'sequence'. Maybe I'm not setting the sequence name properly?
> >>> Like I say, I can't generate the sequence, I have to use the one
> >>> provided by the DBA, but finding an example of this being done using
> >>> annotations has proven difficult.
> >>>
> >>> Thanks for any suggestions,
> >>>
> >>> Jason Henriksen
> >>>
> >>
> >> --
> >>
> >> 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
> >
> >
>
>
> --
>
> 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] Sequence generation problem [message #609435 is a reply to message #92759] |
Wed, 08 August 2007 19:18 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------080508020903000407070303
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi Jason,
Afair sequence generators need to be defined on package level, in xsd this means just below the
xsd:schema element.
See the attachment for an example of one of the testcases.
gr. Martin
Jason Henriksen wrote:
> Hi All,
>
> Am I doing this wrong? I need my object to use a pre-existing sequence, but
> I get this exception:
>
> Caused by: java.lang.IllegalStateException: No sequence generator found with
> the name: SEQ_CMR3605T, name is used in annotation of element
> Address/addressSK
>
> The XSD I'm using looks like this (taken from a JPA annotation reference)
>
> <xsd:element name="addressSK" type="xsd:int">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Id
> @Column(name="ADDRESS_SK" nullable="false")
> @SequenceGenerator(name="SEQ_CMR3605T", sequenceName="SEQ_CMR3605T",
> allocationSize=1)
> @GeneratedValue(strategy=SEQUENCE, generator="SEQ_CMR3605T")
> </xsd:appinfo>
> <xsd:documentation>A generated key to uniquely the
> record.</xsd:documentation>
> </xsd:annotation>
> </xsd:element>
>
>
> Here's the stack trace:
>
> Caused by: java.lang.IllegalStateException: No sequence generator found with
> the name: SEQ_CMR3605T, name is used in annotation of element
> Address/addressSK
> at
> org.eclipse.emf.teneo.annotations.pamodel.impl.PAnnotatedMod elImpl.getSequen
> ceGenerator(PAnnotatedModelImpl.java:462)
> at
> org.eclipse.emf.teneo.hibernate.mapper.IdMapper.processIdPro perty(IdMapper.j
> ava:257)
> at
> org.eclipse.emf.teneo.hibernate.mapper.FeatureMapper.process PAnnotatedEAttri
> bute(FeatureMapper.java:125)
> at
> org.eclipse.emf.teneo.hibernate.mapper.FeatureMapper.process (FeatureMapper.j
> ava:98)
> at
> org.eclipse.emf.teneo.hibernate.mapper.EntityMapper.processF eature(EntityMap
> per.java:490)
> at
> org.eclipse.emf.teneo.hibernate.mapper.EntityMapper.processF eatures(EntityMa
> pper.java:390)
> at
> org.eclipse.emf.teneo.hibernate.mapper.EntityMapper.processE ntity(EntityMapp
> er.java:277)
> at
> org.eclipse.emf.teneo.hibernate.mapper.HibernateMappingGener ator.processPACl
> ass(HibernateMappingGenerator.java:183)
> at
> org.eclipse.emf.teneo.hibernate.mapper.HibernateMappingGener ator.processPers
> istentClasses(HibernateMappingGenerator.java:151)
> at
> org.eclipse.emf.teneo.hibernate.mapper.HibernateMappingGener ator.generate(Hi
> bernateMappingGenerator.java:113)
> at
> org.eclipse.emf.teneo.hibernate.mapper.HibernateMappingGener ator.generateToS
> tring(HibernateMappingGenerator.java:124)
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:55
> 1)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataSto
> re.java:163)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataS
> tore.java:77)
>
>
> (Warning: The line numbers may not line up due to some local hacking, but I
> haven't touched anything to do with sequences)
>
>
>
> 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
--------------080508020903000407070303
Content-Type: text/xml;
name="id.xsd"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="id.xsd"
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/hb/ generator/id"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:lib=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/hb/ generator/id"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:appinfo source="teneo.hibernate">
@GenericGenerator(name="system-uuid", strategy = "uuid")
@GenericGenerator(name="hibseq", strategy = "hilo",
parameters = {
@Parameter(name="table", value = "hilo_table"),
@Parameter(name="column", value="the_hilo_column")
}
)
</xsd:appinfo>
</xsd:annotation>
<xsd:complexType name="SimpleID">
<xsd:sequence>
<xsd:element name="autoID" type="xsd:long">
<xsd:annotation>
<xsd:appinfo source="teneo.hibernate">
@Id @GeneratedValue
@Column(name="AUTOD" nullable="false")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="generated" type="xsd:long">
<xsd:annotation>
<xsd:appinfo source="teneo.hibernate">
@Generated(ALWAYS)
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="TableID">
<xsd:sequence>
<xsd:element name="myid" type="xsd:long">
<xsd:annotation>
<xsd:appinfo source="teneo.hibernate">
@Id @GeneratedValue(generator="hibseq")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IdentityID">
<xsd:sequence>
<xsd:element name="myid" type="xsd:long">
<xsd:annotation>
<xsd:appinfo source="teneo.hibernate">
@Id @GeneratedValue(strategy="IDENTITY")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
--------------080508020903000407070303--
|
|
|
Re: [TENEO] Sequence generation problem [message #609436 is a reply to message #92774] |
Wed, 08 August 2007 22:09 |
Jason Henriksen Messages: 231 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_005B_01C7D9CE.2C0D54B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Martin,
I'm still getting:
2007/08/08 15:02:32:047 PDT [ERROR] AnnotationParserException - The =
eclass: HbAnnotatedEClass does not have an efeature for GenericGenerator =
< org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption: The =
eclass: HbAnnotatedEClass does not have an efeature for =
GenericGenerator>org.eclipse.emf.teneo.annotations.parser.AnnotationParse=
rException: The eclass: HbAnnotatedEClass does not have an efeature for =
GenericGenerator
at =
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
sAnnotatedModelElement(EAnnotationParserImporter.java:130)
at =
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
s(EAnnotationParserImporter.java:71)
at =
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
s(EAnnotationParserImporter.java:64)
at =
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildM=
apping(PersistenceMappingBuilder.java:94)
at =
org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java=
:548)
at =
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionData=
Store.java:163)
at =
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDa=
taStore.java:77)
at com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 )
at com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)
After following your advice and making my code look like this:
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<xsd:schema=20
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"=20
xmlns:ecore=3D"http://www.eclipse.org/emf/2002/Ecore"=20
xmlns:vsp=3D"http://vsp.com/"=20
targetNamespace=3D"http://vsp.com/">
=20
<xsd:annotation><xsd:appinfo source=3D"teneo.hibernate">
@GenericGenerator(
name =3D "SEQ_CMR3601T",
strategy =3D "sequence"
parameters=3D {
@Parameter(name =3D "sequence-name", value =3D =
"SEQ_CMR3601T")
}
)
</xsd:appinfo></xsd:annotation>
=20
=20
<xsd:complexType name=3D"Consumer">
<xsd:sequence>
<xsd:element default=3D"0" name=3D"consumerSK" type=3D"xsd:int">
<xsd:annotation>
<xsd:appinfo source=3D"teneo.jpa">
@Column(name=3DCONSUMER_SK nullable=3D"false")
@Id
@GeneratedValue(generator=3D"SEQ_CMR3601T") =
=20
</xsd:appinfo>
=20
<xsd:documentation>A generated key to uniquely identify =
a person</xsd:documentation>
</xsd:annotation>
</xsd:element>
Could it be that the first annotation is teneo.hibernate while the =
second annotation is teneo.jpa?
(I've used exclusively teneo.jpa thus far). =20
I'm also wondering if you have an example where the strategy is =
'sequence'. Maybe I'm not setting the sequence name properly?
Like I say, I can't generate the sequence, I have to use the one =
provided by the DBA, but finding an example of this being done using =
annotations has proven difficult.
Thanks for any suggestions,
Jason Henriksen
------=_NextPart_000_005B_01C7D9CE.2C0D54B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1561" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff background=3D"">
<DIV><FONT face=3DArial size=3D2>Hi Martin,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'm still getting:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>2007/08/08 15:02:32:047 PDT [ERROR]=20
AnnotationParserException - The eclass: HbAnnotatedEClass does not have =
an=20
efeature for GenericGenerator=20
<org.eclipse.emf.teneo.annotations.parser.AnnotationP arserException: =
The=20
eclass: HbAnnotatedEClass does not have an efeature for=20
GenericGenerator>org.eclipse.emf.teneo.annotations.pa rser.AnnotationPa=
rserException:=20
The eclass: HbAnnotatedEClass does not have an efeature for=20
GenericGenerator<BR> at=20
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
sAnnotatedModelElement(EAnnotationParserImporter.java:130)<BR > at=20
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
s(EAnnotationParserImporter.java:71)<BR> at=20
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.proces=
s(EAnnotationParserImporter.java:64)<BR> at=20
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildM=
apping(PersistenceMappingBuilder.java:94)<BR> at=20
org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java=
:548)<BR> at=20
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionData=
Store.java:163)<BR> at=20
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDa=
taStore.java:77)<BR> at=20
com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 ) <BR> at=
=20
com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)</FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>After following your advice and making =
my code look=20
like this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT size=3D2><FONT face=3DCourier><?xml version=3D"1.0"=20
encoding=3D"UTF-8"?><BR><xsd:schema </FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT face=3DCourier>xmlns:xsd=3D"</FONT><A=20
href=3D"http://www.w3.org/2001/XMLSchema"><FONT=20
face=3DCourier>http://www.w3.org/2001/XMLSchema</FONT></A><FONT =
face=3DCourier>"=20
</FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT face=3DCourier>xmlns:ecore=3D"</FONT><A=20
href=3D"http://www.eclipse.org/emf/2002/Ecore"><FONT=20
face=3DCourier>http://www.eclipse.org/emf/2002/Ecore</FONT></A><FONT=20
face=3DCourier>" </FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT face=3DCourier>xmlns:vsp=3D"</FONT><A=20
href=3D"http://vsp.com/"><FONT =
face=3DCourier>http://vsp.com/</FONT></A><FONT=20
face=3DCourier>" </FONT></FONT></DIV>
<DIV><FONT size=3D2><FONT face=3DCourier>targetNamespace=3D"</FONT><A=20
href=3D"http://vsp.com/"><FONT =
face=3DCourier>http://vsp.com/</FONT></A><FONT=20
face=3DCourier>"><BR> <BR> =20
<xsd:annotation><xsd:appinfo=20
source=3D"teneo.hibernate"><BR> =20
@GenericGenerator(<BR> name =
=3D=20
"SEQ_CMR3601T",<BR> strategy =
=3D=20
"sequence"<BR> parameters=3D=20
{<BR> =20
@Parameter(name =3D "sequence-name", value =3D=20
"SEQ_CMR3601T")<BR> =20
}<BR> )<BR> =20
</xsd:appinfo></xsd:annotation><BR > =20
<BR> <BR> <xsd:complexType=20
name=3D"Consumer"><BR> =20
<xsd:sequence><BR> <xsd:element=20
default=3D"0" name=3D"consumerSK"=20
type=3D"xsd:int"><BR> &=
nbsp; =20
<xsd:annotation><BR>  =
;   ; =20
<xsd:appinfo=20
source=3D"teneo.jpa"><BR> &nb=
sp; &nb sp; =20
@Column(name=3DCONSUMER_SK=20
nullable=3D"false")<BR> &n=
bsp; &n bsp;=20
@Id<BR> =
=20
@GeneratedValue(generator=3D"SEQ_CMR3601T") =
=20
<BR> &nb=
sp; =20
</xsd:appinfo><BR> &=
nbsp; & nbsp;=20
<BR> &nb=
sp; =20
<xsd:documentation>A generated key to uniquely identify a=20
person</xsd:documentation><BR> &=
nbsp; =20
</xsd:annotation><BR> =20
</xsd:element></FONT></FONT></DIV>
<DIV><FONT face=3DCourier size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Could it be that the first annotation =
is=20
teneo.hibernate while the second annotation is teneo.jpa?<BR>(I've used=20
exclusively teneo.jpa thus far). </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I'm also wondering if you have an =
example where the=20
strategy is 'sequence'. Maybe I'm not setting the sequence name=20
properly?<BR>Like I say, I can't generate the sequence, I have to use =
the one=20
provided by the DBA, but finding an example of this being done using =
annotations=20
has proven difficult.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for any =
suggestions,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2> &nbs=
p; =20
Jason=20
Henriksen<BR> =
=20
</FONT></DIV></BODY></HTML>
------=_NextPart_000_005B_01C7D9CE.2C0D54B0--
|
|
|
Re: [TENEO] Sequence generation problem [message #609437 is a reply to message #92789] |
Wed, 08 August 2007 22:25 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Jason,
With my testcase the annotation in the top of the xsd gets translated to an annotation of the
epackage. This is how it should be. It seems that with you it gets translated to an annotation on an
EClass. Can you check in your ecore (or post that relevant part)?
gr. Martin
Jason Henriksen wrote:
> Hi Martin,
>
> I'm still getting:
>
> 2007/08/08 15:02:32:047 PDT [ERROR] AnnotationParserException - The
> eclass: HbAnnotatedEClass does not have an efeature for GenericGenerator
> < org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption: The
> eclass: HbAnnotatedEClass does not have an efeature for
> GenericGenerator> org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption:
> The eclass: HbAnnotatedEClass does not have an efeature for GenericGenerator
> at
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.processAnnotatedModelElement(EAnnotationParserImporte r.java:130)
> at
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(EAnnotationParserImporter.java:71)
> at
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(EAnnotationParserImporter.java:64)
> at
> org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapping(PersistenceMappingBuilder.java:94)
> at
> org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:548)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataStore.java:163)
> at
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataStore.java:77)
> at com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 )
> at com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)
>
> After following your advice and making my code look like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsd:schema
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:vsp="http://vsp.com/"
> targetNamespace="http://vsp.com/">
>
> <xsd:annotation><xsd:appinfo source="teneo.hibernate">
> @GenericGenerator(
> name = "SEQ_CMR3601T",
> strategy = "sequence"
> parameters= {
> @Parameter(name = "sequence-name", value = "SEQ_CMR3601T")
> }
> )
> </xsd:appinfo></xsd:annotation>
>
>
> <xsd:complexType name="Consumer">
> <xsd:sequence>
> <xsd:element default="0" name="consumerSK" type="xsd:int">
> <xsd:annotation>
> <xsd:appinfo source="teneo.jpa">
> @Column(name=CONSUMER_SK nullable="false")
> @Id
> @GeneratedValue(generator="SEQ_CMR3601T")
> </xsd:appinfo>
>
> <xsd:documentation>A generated key to uniquely identify
> a person</xsd:documentation>
> </xsd:annotation>
> </xsd:element>
>
>
> Could it be that the first annotation is teneo.hibernate while the
> second annotation is teneo.jpa?
> (I've used exclusively teneo.jpa thus far).
>
> I'm also wondering if you have an example where the strategy is
> 'sequence'. Maybe I'm not setting the sequence name properly?
> Like I say, I can't generate the sequence, I have to use the one
> provided by the DBA, but finding an example of this being done using
> annotations has proven difficult.
>
> Thanks for any suggestions,
>
> Jason Henriksen
>
--
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] Sequence generation problem [message #609438 is a reply to message #92804] |
Wed, 08 August 2007 22:57 |
Jason Henriksen Messages: 231 Registered: July 2009 |
Senior Member |
|
|
Hi Martin,
Here are all the pieces in full.
Thanks or any help,
Jason
"Martin Taal" <mtaal@elver.org> wrote in message
news:f9dfta$92j$1@build.eclipse.org...
> Hi Jason,
> With my testcase the annotation in the top of the xsd gets translated to
an annotation of the
> epackage. This is how it should be. It seems that with you it gets
translated to an annotation on an
> EClass. Can you check in your ecore (or post that relevant part)?
>
> gr. Martin
>
> Jason Henriksen wrote:
> > Hi Martin,
> >
> > I'm still getting:
> >
> > 2007/08/08 15:02:32:047 PDT [ERROR] AnnotationParserException - The
> > eclass: HbAnnotatedEClass does not have an efeature for GenericGenerator
> > < org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption: The
> > eclass: HbAnnotatedEClass does not have an efeature for
> >
GenericGenerator>org.eclipse.emf.teneo.annotations.parser.AnnotationParserEx
ception:
> > The eclass: HbAnnotatedEClass does not have an efeature for
GenericGenerator
> > at
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.processAn
notatedModelElement(EAnnotationParserImporter.java:130)
> > at
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
AnnotationParserImporter.java:71)
> > at
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
AnnotationParserImporter.java:64)
> > at
> >
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapp
ing(PersistenceMappingBuilder.java:94)
> > at
> >
org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:54
8)
> > at
> >
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataSto
re.java:163)
> > at
> >
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataS
tore.java:77)
> > at com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 )
> > at com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)
> >
> > After following your advice and making my code look like this:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsd:schema
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> > xmlns:vsp="http://vsp.com/"
> > targetNamespace="http://vsp.com/">
> >
> > <xsd:annotation><xsd:appinfo source="teneo.hibernate">
> > @GenericGenerator(
> > name = "SEQ_CMR3601T",
> > strategy = "sequence"
> > parameters= {
> > @Parameter(name = "sequence-name", value = "SEQ_CMR3601T")
> > }
> > )
> > </xsd:appinfo></xsd:annotation>
> >
> >
> > <xsd:complexType name="Consumer">
> > <xsd:sequence>
> > <xsd:element default="0" name="consumerSK" type="xsd:int">
> > <xsd:annotation>
> > <xsd:appinfo source="teneo.jpa">
> > @Column(name=CONSUMER_SK nullable="false")
> > @Id
> > @GeneratedValue(generator="SEQ_CMR3601T")
> > </xsd:appinfo>
> >
> > <xsd:documentation>A generated key to uniquely identify
> > a person</xsd:documentation>
> > </xsd:annotation>
> > </xsd:element>
> >
> >
> > Could it be that the first annotation is teneo.hibernate while the
> > second annotation is teneo.jpa?
> > (I've used exclusively teneo.jpa thus far).
> >
> > I'm also wondering if you have an example where the strategy is
> > 'sequence'. Maybe I'm not setting the sequence name properly?
> > Like I say, I can't generate the sequence, I have to use the one
> > provided by the DBA, but finding an example of this being done using
> > annotations has proven difficult.
> >
> > Thanks for any suggestions,
> >
> > Jason Henriksen
> >
>
>
> --
>
> 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] Sequence generation problem [message #609439 is a reply to message #92819] |
Thu, 09 August 2007 03:28 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Hi Jason,
The @GenericGenerator is currently not supported at the EClass level only at package level. In your
model (customer.ecore) I can see that there are GenericGenerator annotations in the Address,
EmailType, Member and Phone EClasses. These should all be moved to the package level. Having
multiple GenericGenerator annotations at package level should work.
Hibernate annotations allows genericgenerator annotations on class level also. So Teneo should also
support this. Can you enter a bugzilla for this?
gr. Martin
Jason Henriksen wrote:
> Hi Martin,
>
> Here are all the pieces in full.
>
> Thanks or any help,
>
> Jason
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:f9dfta$92j$1@build.eclipse.org...
>> Hi Jason,
>> With my testcase the annotation in the top of the xsd gets translated to
> an annotation of the
>> epackage. This is how it should be. It seems that with you it gets
> translated to an annotation on an
>> EClass. Can you check in your ecore (or post that relevant part)?
>>
>> gr. Martin
>>
>> Jason Henriksen wrote:
>>> Hi Martin,
>>>
>>> I'm still getting:
>>>
>>> 2007/08/08 15:02:32:047 PDT [ERROR] AnnotationParserException - The
>>> eclass: HbAnnotatedEClass does not have an efeature for GenericGenerator
>>> < org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption: The
>>> eclass: HbAnnotatedEClass does not have an efeature for
>>>
> GenericGenerator>org.eclipse.emf.teneo.annotations.parser.AnnotationParserEx
> ception:
>>> The eclass: HbAnnotatedEClass does not have an efeature for
> GenericGenerator
>>> at
>>>
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.processAn
> notatedModelElement(EAnnotationParserImporter.java:130)
>>> at
>>>
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
> AnnotationParserImporter.java:71)
>>> at
>>>
> org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
> AnnotationParserImporter.java:64)
>>> at
>>>
> org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapp
> ing(PersistenceMappingBuilder.java:94)
>>> at
>>>
> org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:54
> 8)
>>> at
>>>
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataSto
> re.java:163)
>>> at
>>>
> org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataS
> tore.java:77)
>>> at com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 )
>>> at com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)
>>>
>>> After following your advice and making my code look like this:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <xsd:schema
>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>>> xmlns:vsp="http://vsp.com/"
>>> targetNamespace="http://vsp.com/">
>>>
>>> <xsd:annotation><xsd:appinfo source="teneo.hibernate">
>>> @GenericGenerator(
>>> name = "SEQ_CMR3601T",
>>> strategy = "sequence"
>>> parameters= {
>>> @Parameter(name = "sequence-name", value = "SEQ_CMR3601T")
>>> }
>>> )
>>> </xsd:appinfo></xsd:annotation>
>>>
>>>
>>> <xsd:complexType name="Consumer">
>>> <xsd:sequence>
>>> <xsd:element default="0" name="consumerSK" type="xsd:int">
>>> <xsd:annotation>
>>> <xsd:appinfo source="teneo.jpa">
>>> @Column(name=CONSUMER_SK nullable="false")
>>> @Id
>>> @GeneratedValue(generator="SEQ_CMR3601T")
>>> </xsd:appinfo>
>>>
>>> <xsd:documentation>A generated key to uniquely identify
>>> a person</xsd:documentation>
>>> </xsd:annotation>
>>> </xsd:element>
>>>
>>>
>>> Could it be that the first annotation is teneo.hibernate while the
>>> second annotation is teneo.jpa?
>>> (I've used exclusively teneo.jpa thus far).
>>>
>>> I'm also wondering if you have an example where the strategy is
>>> 'sequence'. Maybe I'm not setting the sequence name properly?
>>> Like I say, I can't generate the sequence, I have to use the one
>>> provided by the DBA, but finding an example of this being done using
>>> annotations has proven difficult.
>>>
>>> Thanks for any suggestions,
>>>
>>> Jason Henriksen
>>>
>>
>> --
>>
>> 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
>
>
--
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] Sequence generation problem [message #609443 is a reply to message #92838] |
Thu, 09 August 2007 16:33 |
Jason Henriksen Messages: 231 Registered: July 2009 |
Senior Member |
|
|
No problem Martin.
I should have moved them all up. I only moved Consumer up thinking I could
test that seperately, but I guess the non-Consumer classes were still
causing a problem.
I'll get that bugzilla entry in today.
Jason Henriksen
"Martin Taal" <mtaal@elver.org> wrote in message
news:f9e1lm$2at$1@build.eclipse.org...
> Hi Jason,
> The @GenericGenerator is currently not supported at the EClass level only
at package level. In your
> model (customer.ecore) I can see that there are GenericGenerator
annotations in the Address,
> EmailType, Member and Phone EClasses. These should all be moved to the
package level. Having
> multiple GenericGenerator annotations at package level should work.
>
> Hibernate annotations allows genericgenerator annotations on class level
also. So Teneo should also
> support this. Can you enter a bugzilla for this?
>
> gr. Martin
>
> Jason Henriksen wrote:
> > Hi Martin,
> >
> > Here are all the pieces in full.
> >
> > Thanks or any help,
> >
> > Jason
> >
> > "Martin Taal" <mtaal@elver.org> wrote in message
> > news:f9dfta$92j$1@build.eclipse.org...
> >> Hi Jason,
> >> With my testcase the annotation in the top of the xsd gets translated
to
> > an annotation of the
> >> epackage. This is how it should be. It seems that with you it gets
> > translated to an annotation on an
> >> EClass. Can you check in your ecore (or post that relevant part)?
> >>
> >> gr. Martin
> >>
> >> Jason Henriksen wrote:
> >>> Hi Martin,
> >>>
> >>> I'm still getting:
> >>>
> >>> 2007/08/08 15:02:32:047 PDT [ERROR] AnnotationParserException - The
> >>> eclass: HbAnnotatedEClass does not have an efeature for
GenericGenerator
> >>> < org.eclipse.emf.teneo.annotations.parser.AnnotationParserExc eption:
The
> >>> eclass: HbAnnotatedEClass does not have an efeature for
> >>>
> >
GenericGenerator>org.eclipse.emf.teneo.annotations.parser.AnnotationParserEx
> > ception:
> >>> The eclass: HbAnnotatedEClass does not have an efeature for
> > GenericGenerator
> >>> at
> >>>
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.processAn
> > notatedModelElement(EAnnotationParserImporter.java:130)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
> > AnnotationParserImporter.java:71)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.annotations.parser.EAnnotationParserIm porter.process(E
> > AnnotationParserImporter.java:64)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.annotations.mapper.PersistenceMappingB uilder.buildMapp
> > ing(PersistenceMappingBuilder.java:94)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.hibernate.HbDataStore.mapEPackages(HbD ataStore.java:54
> > 8)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.mapModel( HbSessionDataSto
> > re.java:163)
> >>> at
> >>>
> >
org.eclipse.emf.teneo.hibernate.HbSessionDataStore.initializ e(HbSessionDataS
> > tore.java:77)
> >>> at com.vsp.test.DBUpdateTest.getDataStore(DBUpdateTest.java:174 )
> >>> at com.vsp.test.DBUpdateTest.main(DBUpdateTest.java:79)
> >>>
> >>> After following your advice and making my code look like this:
> >>>
> >>> <?xml version="1.0" encoding="UTF-8"?>
> >>> <xsd:schema
> >>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> >>> xmlns:vsp="http://vsp.com/"
> >>> targetNamespace="http://vsp.com/">
> >>>
> >>> <xsd:annotation><xsd:appinfo source="teneo.hibernate">
> >>> @GenericGenerator(
> >>> name = "SEQ_CMR3601T",
> >>> strategy = "sequence"
> >>> parameters= {
> >>> @Parameter(name = "sequence-name", value = "SEQ_CMR3601T")
> >>> }
> >>> )
> >>> </xsd:appinfo></xsd:annotation>
> >>>
> >>>
> >>> <xsd:complexType name="Consumer">
> >>> <xsd:sequence>
> >>> <xsd:element default="0" name="consumerSK" type="xsd:int">
> >>> <xsd:annotation>
> >>> <xsd:appinfo source="teneo.jpa">
> >>> @Column(name=CONSUMER_SK nullable="false")
> >>> @Id
> >>> @GeneratedValue(generator="SEQ_CMR3601T")
> >>> </xsd:appinfo>
> >>>
> >>> <xsd:documentation>A generated key to uniquely
identify
> >>> a person</xsd:documentation>
> >>> </xsd:annotation>
> >>> </xsd:element>
> >>>
> >>>
> >>> Could it be that the first annotation is teneo.hibernate while the
> >>> second annotation is teneo.jpa?
> >>> (I've used exclusively teneo.jpa thus far).
> >>>
> >>> I'm also wondering if you have an example where the strategy is
> >>> 'sequence'. Maybe I'm not setting the sequence name properly?
> >>> Like I say, I can't generate the sequence, I have to use the one
> >>> provided by the DBA, but finding an example of this being done using
> >>> annotations has proven difficult.
> >>>
> >>> Thanks for any suggestions,
> >>>
> >>> Jason Henriksen
> >>>
> >>
> >> --
> >>
> >> 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
> >
> >
>
>
> --
>
> 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
|
|
|
Goto Forum:
Current Time: Tue Apr 23 08:57:36 GMT 2024
Powered by FUDForum. Page generated in 0.05288 seconds
|