Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Problem with Audit on Teneo
[Teneo] Problem with Audit on Teneo [message #1049387] Thu, 25 April 2013 19:44 Go to next message
Cristian Prevedello is currently offline Cristian PrevedelloFriend
Messages: 33
Registered: June 2011
Member
Today i tried to turn on Audit feature on Teneo, but the generated xml mapping is invalid.

Somehow for a couple of entities the mapping is screwed up.

<class name="org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.impl.TeneoAuditEntryImpl" entity-name="DLLGaussAuditing" abstract="false" lazy="true" discriminator-value="DLLGaussAuditing" table="dllgaussauditing" proxy="org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.impl.TeneoAuditEntryImpl">
		<meta attribute="eclassName" inherit="false">DLLGaussAuditing</meta>
		<meta attribute="epackage" inherit="false">http://viewshapemodel/1.0Auditing</meta>
		<id name="teneo_audit_id" type="long" unsaved-value="0">
			<column not-null="true" unique="false" name="teneo_audit_id"/>
			<generator class="native"/>
		</id>
		<discriminator type="string">
			<column name="dtype" index="dllgaussauditingdtype" length="255" not-null="true"/>
		</discriminator>
		<version name="teneo_version" type="long">
			<column not-null="true" unique="false" name="teneo_version"/>
		</version>
		<property name="teneo_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
			<column not-null="false" unique="false" name="teneo_object_id" unique-key="c0,c1,c2"/>
		</property>
		<property name="teneo_owner_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
			<column not-null="false" unique="false" name="teneo_owner_object_id"/>
		</property>
		<property name="teneo_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long">
			<column not-null="false" unique="false" name="teneo_start" unique-key="c0"/>
		</property>
		<property name="teneo_end" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long">
			<column not-null="false" unique="false" name="teneo_end" unique-key="c1"/>
		</property>
		<many-to-one name="teneo_commit_info" entity-name="TeneoAuditCommitInfo" lazy="proxy" foreign-key="dllgaussauditing_teneo_commit_info" insert="true" update="true" not-null="true">
			<column not-null="true" unique="false" name="teneoauditcommitinfo_teneo_commit_info_id"/>
		</many-to-one>
		<property name="teneo_audit_kind" lazy="false" not-null="true" insert="true" update="true" unique="false">
			<column not-null="true" unique="false" name="teneo_audit_kind"/>
			<type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType">
				<param name="enumClass">org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoAuditKind</param>
				<param name="eclassifier">TeneoAuditKind</param>
				<param name="epackage">http://www.eclipse.org/emf/teneo/hibernate/auditing</param>
			</type>
		</property>
		<property name="teneo_container_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
			<column not-null="false" unique="false" name="teneo_container_id"/>
		</property>
		<property name="teneo_container_feature_id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int">
			<column not-null="false" unique="false" name="teneo_container_feature_id"/>
		</property>
		<property name="teneo_previous_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long">
			<column not-null="false" unique="false" name="teneo_previous_start" unique-key="c2"/>
		</property>
		<property name="teneo_object_version" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long">
			<column not-null="false" unique="false" name="teneo_object_version"/>
		</property>
		<property name="teneo_resourceid" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
			<column not-null="false" unique="false" name="teneo_resourceid"/>
		</property>
		<property name="Id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long">
			<column not-null="false" unique="false" name="id"/>
		</property>
		<property name="IdEntity" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long">
			<column not-null="false" unique="false" name="identity"/>
		</property>
		<property name="NomeDLL" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
			<column not-null="false" unique="false" name="nomedll"/>
		</property>
		<property name="Versione" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int">
			<column not-null="false" unique="false" name="versione"/>
		</property>
		[b]<version name="e_version" type="int">
			<column not-null="true" unique="false" name="e_version"/>
		</version>[/b]
		<list name="CampiAusil" table="dllgaussauditing_campiausilauditing" lazy="true" cascade="all">
			<key foreign-key="dllgaussauditing_campiausil_key" update="true">
				<column name="dllgaussauditing_campiausil_teneo_audit_id" unique="false"/>
			</key>
			<list-index column="dllgaussauditing_campiausil_idx"/>
			<element type="java.lang.String"/>
		</list>
	</class>



dunno why, but for this entity teneo is adding another version property other than the teneo_version declared at the beginning.

In the EMF model this my e_version property is annotated with @Version like all other entities..so have no clue why this entity is being treated differently...

thank you for your help

[Updated on: Thu, 25 April 2013 20:34]

Report message to a moderator

Re: Problem with Audit on Teneo [message #1049468 is a reply to message #1049387] Thu, 25 April 2013 22:37 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Cristian,
Hmm seems to be a bug..., can you remove the @Version annotation and see what happens?
Can you enter a bugzilla for this?

gr. Martin

On 04/25/2013 09:44 PM, Cristian Prevedello wrote:
> Today i tried to turn on Audit feature on Teneo, but generated xml mapping is invalid.
>
> Somehow for a couple of entities the mapping is screwed up.
>
>
> <class name="org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.impl.TeneoAuditEntryImpl"
> entity-name="DLLGaussAuditing" abstract="false" lazy="true" discriminator-value="DLLGaussAuditing"
> table="dllgaussauditing" proxy="org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.impl.TeneoAuditEntryImpl">
> <meta attribute="eclassName" inherit="false">DLLGaussAuditing</meta>
> <meta attribute="epackage" inherit="false">http://viewshapemodel/1.0Auditing</meta>
> <id name="teneo_audit_id" type="long" unsaved-value="0">
> <column not-null="true" unique="false" name="teneo_audit_id"/>
> <generator class="native"/>
> </id>
> <discriminator type="string">
> <column name="dtype" index="dllgaussauditingdtype" length="255" not-null="true"/>
> </discriminator>
> <version name="teneo_version" type="long">
> <column not-null="true" unique="false" name="teneo_version"/>
> </version>
> <property name="teneo_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false"
> type="java.lang.String">
> <column not-null="false" unique="false" name="teneo_object_id" unique-key="c0,c1,c2"/>
> </property>
> <property name="teneo_owner_object_id" lazy="false" insert="true" update="true" not-null="false" unique="false"
> type="java.lang.String">
> <column not-null="false" unique="false" name="teneo_owner_object_id"/>
> </property>
> <property name="teneo_start" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long">
> <column not-null="false" unique="false" name="teneo_start" unique-key="c0"/>
> </property>
> <property name="teneo_end" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long">
> <column not-null="false" unique="false" name="teneo_end" unique-key="c1"/>
> </property>
> <many-to-one name="teneo_commit_info" entity-name="TeneoAuditCommitInfo" lazy="proxy"
> foreign-key="dllgaussauditing_teneo_commit_info" insert="true" update="true" not-null="true">
> <column not-null="true" unique="false" name="teneoauditcommitinfo_teneo_commit_info_id"/>
> </many-to-one>
> <property name="teneo_audit_kind" lazy="false" not-null="true" insert="true" update="true" unique="false">
> <column not-null="true" unique="false" name="teneo_audit_kind"/>
> <type name="org.eclipse.emf.teneo.hibernate.mapping.ENumUserType">
> <param
> name="enumClass">org.eclipse.emf.teneo.hibernate.auditing.model.teneoauditing.TeneoAuditKind</param>
> <param name="eclassifier">TeneoAuditKind</param>
> <param name="epackage">http://www.eclipse.org/emf/teneo/hibernate/auditing</param>
> </type>
> </property>
> <property name="teneo_container_id" lazy="false" insert="true" update="true" not-null="false" unique="false"
> type="java.lang.String">
> <column not-null="false" unique="false" name="teneo_container_id"/>
> </property>
> <property name="teneo_container_feature_id" lazy="false" insert="true" update="true" not-null="false"
> unique="false" type="int">
> <column not-null="false" unique="false" name="teneo_container_feature_id"/>
> </property>
> <property name="teneo_previous_start" lazy="false" insert="true" update="true" not-null="false" unique="false"
> type="long">
> <column not-null="false" unique="false" name="teneo_previous_start" unique-key="c2"/>
> </property>
> <property name="teneo_object_version" lazy="false" insert="true" update="true" not-null="false" unique="false"
> type="long">
> <column not-null="false" unique="false" name="teneo_object_version"/>
> </property>
> <property name="teneo_resourceid" lazy="false" insert="true" update="true" not-null="false" unique="false"
> type="java.lang.String">
> <column not-null="false" unique="false" name="teneo_resourceid"/>
> </property>
> <property name="Id" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long">
> <column not-null="false" unique="false" name="id"/>
> </property>
> <property name="IdEntity" lazy="false" insert="true" update="true" not-null="false" unique="false" type="long">
> <column not-null="false" unique="false" name="identity"/>
> </property>
> <property name="NomeDLL" lazy="false" insert="true" update="true" not-null="false" unique="false"
> type="java.lang.String">
> <column not-null="false" unique="false" name="nomedll"/>
> </property>
> <property name="Versione" lazy="false" insert="true" update="true" not-null="false" unique="false" type="int">
> <column not-null="false" unique="false" name="versione"/>
> </property>
> <version name="e_version" type="int">
> <column not-null="true" unique="false" name="e_version"/>
> </version>

> <list name="CampiAusil" table="dllgaussauditing_campiausilauditing" lazy="true" cascade="all">
> <key foreign-key="dllgaussauditing_campiausil_key" update="true">
> <column name="dllgaussauditing_campiausil_teneo_audit_id" unique="false"/>
> </key>
> <list-index column="dllgaussauditing_campiausil_idx"/>
> <element type="java.lang.String"/>
> </list>
> </class>
>
>
>
> dunno why, but for this entity teneo is adding another version property other than the teneo_version declared at the
> beginning.
>
> In the EMF model this my e_version property is annotated with @Version like all other entities..so have no clue why this
> entity is being treated differently...
>
> thank you for your help


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@xxxxxxxx - mtaal@xxxxxxxx
Web: www.springsite.com - www.elver.org
Re: Problem with Audit on Teneo [message #1049806 is a reply to message #1049468] Fri, 26 April 2013 09:48 Go to previous message
Cristian Prevedello is currently offline Cristian PrevedelloFriend
Messages: 33
Registered: June 2011
Member
To find the reason of this wrong mapping i debugged AuditHandler class and i noticed at line 682, jpaEAnnotation's detail was empty..and i discovered what was wrong with my annotation.

 <eStructuralFeatures xsi:type="ecore:EAttribute" name="e_version" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt">
      <eAnnotations source="teneo.jpa">
        <details key="[b]V[/b]alue" value="@Version"/>
      </eAnnotations>
    </eStructuralFeatures>


the key value was not lower case, but was capitalized. Teneo is working fine with hibernate mappings, but auditing is more picky. i reverted everything to lowercase and now auditing mapping is correct and working.

do you still want me to open a bug about this?

thank you
Previous Topic:ExtendedMetaData
Next Topic:[TENEO] how to read existing EPackages from DataStore?
Goto Forum:
  


Current Time: Fri Apr 19 21:37:43 GMT 2024

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

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

Back to the top