Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Re: [Teneo] new user questions
Re: [Teneo] new user questions [message #606805] Sat, 26 May 2007 04:47
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000301000809040603090802
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jason,
I see now that the epackage element in the annotation xml misses the
namespace-uri attribute. This attribute has to be present and it has too
be set to the nsuri as it is set in the eNS_URI member of the generated
java interface file (or if no java code is generated to the nsuri from
the ecore). Also the root node persistence-mapping seems to be missing
(maybe you did not list the complete xml file). I attached an example of
a transient annotations xml.

Another thing to watch out for is that the annotations.xml is actually
copied to the output folder. Normally this works fine in Eclipse but not
always.

Regarding your other question: there is a getPaModel method on the
datastore which gives you back the fully jpa annotated model. However it
is a fair amount of work to traverse it in debug mode. Therefore it is
better if there is a annotated model dump to xml. If you can enter a
bugzilla feature request for that then that would be great.

gr. Martin

Jason Henriksen wrote:
> Hi Martin,
>
> I appreciate the help, but unfortunately adding the '/' didn't work. Is
> there any other way to set the annotations? I can see that the property
> file is loaded, but I still see the table created. Is there anyway to
> have the software give me back the annotations that it's using? The xml
> file is right beside the teneo.property files in the root of the class
> path. I load the props fine, but get no love on the xml.
>
> Thanks again,
>
> Jason
>
>
>
> "Martin Taal" <mtaal@elver.org> wrote in message
> news:<f37a4l$38d$1@build.eclipse.org>...
>
>> Hi Jason,
>> The persistence xml option should be a classpath resource, so you need
>>
>
>
>> to add the / before the xml
>> filename:
>> PersistenceOptions.PERSISTENCE_XML=/teneo.annotations.xml
>> (this assumes that the teneo.annotations.xml is in the root of the
>>
> classpath)
>
>> There is no option yet to let an embeddable class be embedded
>> everywhere. You currently have to set
>> the Embedded annotation on each ereference. Please enter a bugzilla
>>
> feature request to let Teneo
>
>> automatically embed all embeddable types.
>>
>> gr. Martin
>>
>> Jason Henriksen wrote:
>>
>>> Hi All,
>>>
>>> I'm very excited about the use of teneo but I'm running into a
>>> couple of basic problems, both of which have to do with controlling
>>> the mapping. For reference, I'm using the 0.8.0 version on EMF/SDO
>>> objectes generated from XSD in RAD 7.
>>>
>>> Here's my teneo.annotations.xml file:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <epackage
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>
>>> xsi:schemaLocation="http://www.elver.org/xsd/teneo/persistence-mappi
>>> ng-hiber
>>> nate.xsd">
>>>
>>> <!-- This has no effect -->
>>> <eclass name="CreateType">
>>> <transient/>
>>> </eclass>
>>>
>>> <!-- Neither does this -->
>>> <eclass name="VSPDate">
>>> <embeddable/>
>>> </eclass>
>>> <eclass name="VSPDateTime">
>>> <embeddable/>
>>> </eclass>
>>> </epackage>
>>>
>>> I have never used teneo or emf for a large project before, and only
>>> used hibernate years ago. My goal is to make the CreateType not
>>> appear in the database at all (It's just a SOAP wrapper) and I'd
>>> like the date objects to be embedded directly into the table that
>>> uses them instead of them being a sepeate table connected with a
>>> join.
>>>
>>> Is this possible right now? I saw some posts about problems with
>>> transient, but I wasn't sure if there was a way to work around that
>>> or not. I also some something that I could make a specific use of
>>> an object embedded, but I haven't found a way to make all uses of an
>>>
>
>
>>> object type embedded.
>>>
>>> My teneo.properties file only contains:
>>> PersistenceOptions.PERSISTENCE_XML=teneo.annotations.xml
>>>
>>> Both the properties and the xml are located in the same place as the
>>>
>
>
>>> documenation puts the hibernate.properties and the log4j.properties.
>>>
>
>
>>> I only mention this because the output log doesn't mention anything
>>> about loading the annotations...
>>>
>>> Thank you for any suggestions you could offer,
>>>
>>> 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
>>
>
> ============================================================ ==================
> "Attention: This message is intended only for the individual to whom it is addressed and may contain information that is confidential or privileged. If you are not the intended recipient, or the employee or person responsible for delivering it to the intended recipient, you are hereby notified that any dissemination, distribution, copying or use is strictly prohibited. If you have received this communication in error, please notify the sender and destroy or delete this communication immediately."
> ============================================================ ==================
>
>

--

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


--------------000301000809040603090802
Content-Type: text/xml;
name="TransientAction.persistence.xml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="TransientAction.persistence.xml"

<?xml version="1.0" encoding="utf-8"?>
<persistence-mapping xmlns="http://www.eclipse.org/emft/teneo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<epackage namespace-uri=" http://www.eclipse.org/emf/teneo/samples/emf/annotations/tra nsent">

<eclass name="Body">
<property name="theID">
<id/>
</property>
</eclass>

<eclass name="Head">
<transient/>
</eclass>

</epackage>

</persistence-mapping>
--------------000301000809040603090802--
Previous Topic:Re: [Teneo] new user questions
Next Topic:[Teneo] Resolving lists
Goto Forum:
  


Current Time: Thu Jan 21 16:02:15 GMT 2021

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

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

Back to the top