Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] EMap Table not created
[Teneo] EMap Table not created [message #754552] Thu, 03 November 2011 09:12 Go to next message
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 211
Registered: July 2009
Location: Switzerland
Senior Member
ciao Martin

I just modeled an EMap as described here: http://wiki.eclipse.org/index.php/EMF-FAQ#How_do_I_create_a_Map_in_EMF.3F
The reduced model is attached.

If I set the option "teneo.mapping.emap_as_true_map" to false, a reference table is created and I can store objects. If I don't set the option, no table at all is created and I can't store any objects.

Could this be a bug? I'm using the latest build: 1.2.0.v201111021608

Could the options be responsible?

<property name="hibernateProperties">
	<props>
		<prop key="hibernate.ejb.metamodel.generation">disabled</prop>		 
		<prop key="hibernate.transaction.auto_close_session">true</prop>
		<prop key="hibernate.transaction.flush_before_completion">true</prop>
		<prop key="hibernate.temp.use_jdbc_metadata_defaults">false</prop>
		<prop key="hibernate.hbm2ddl.auto">update</prop>
		<prop key="hibernate.jdbc.batch_size">2000</prop>
		<prop key="hibernate.cache.use_query_cache">false</prop>
		<prop key="hibernate.cache.use_second_level_cache">false</prop> 
		<prop key="javax.persistence.transactionType">JTA</prop>
		<prop key="hibernate.transaction.manager_lookup_class">com.softmodeler.server.persistence.SoftmodelerTransactionManagerLookup</prop>
	</props>
</property>
<property name="persistenceProperties">
	<props>
		<!-- <prop key="teneo.mapping.emap_as_true_map">false</prop> -->
		<prop key="teneo.naming.default_id_feature">id</prop>
		<prop key="teneo.mapping.always_version">false</prop>
		<prop key="teneo.mapping.inheritance">TABLE_PER_CLASS</prop>
		<prop key="teneo.mapping.disable_econtainer">true</prop>
		<prop key="teneo.mapping.cascade_policy_on_non_containment">REFRESH</prop>

		<prop key="teneo.mapping.fetch_containment_eagerly">true</prop>
		<prop key="teneo.naming.sql_fk_name_prefix">fk_</prop>
	</props>
</property>


greets
Flavio


Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
Re: [Teneo] EMap Table not created [message #754560 is a reply to message #754552] Thu, 03 November 2011 09:46 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
He Flavio,
Before I try out the ecore model myself, do you see any hibernate errors/warnings when the database model gets created?
My feel is that there is something wrong with the ddl, otherwise you would see a table being created.

gr. Martin

On 11/03/2011 10:12 AM, Flavio Donze wrote:
> ciao Martin
>
> I just modeled an EMap as described here: http://wiki.eclipse.org/index.php/EMF-FAQ#How_do_I_create_a_Map_in_EMF.3F
> The reduced model is attached.
>
> If I set the option "teneo.mapping.emap_as_true_map" to false, a reference table is created and I can store objects. If I don't set the option, no table at all is created and I can't store any objects.
>
> Could this be a bug? I'm using the latest build: 1.2.0.v201111021608
>
> Could the options be responsible?
>
>
> <property name="hibernateProperties">
> <props>
> <prop key="hibernate.ejb.metamodel.generation">disabled</prop>
> <prop key="hibernate.transaction.auto_close_session">true</prop>
> <prop key="hibernate.transaction.flush_before_completion">true</prop>
> <prop key="hibernate.temp.use_jdbc_metadata_defaults">false</prop>
> <prop key="hibernate.hbm2ddl.auto">update</prop>
> <prop key="hibernate.jdbc.batch_size">2000</prop>
> <prop key="hibernate.cache.use_query_cache">false</prop>
> <prop key="hibernate.cache.use_second_level_cache">false</prop>
> <prop key="javax.persistence.transactionType">JTA</prop>
> <prop key="hibernate.transaction.manager_lookup_class">com.softmodeler.server.persistence.SoftmodelerTransactionManagerLookup</prop>
> </props>
> </property>
> <property name="persistenceProperties">
> <props>
> <!--<prop key="teneo.mapping.emap_as_true_map">false</prop> -->
> <prop key="teneo.naming.default_id_feature">id</prop>
> <prop key="teneo.mapping.always_version">false</prop>
> <prop key="teneo.mapping.inheritance">TABLE_PER_CLASS</prop>
> <prop key="teneo.mapping.disable_econtainer">true</prop>
> <prop key="teneo.mapping.cascade_policy_on_non_containment">REFRESH</prop>
>
> <prop key="teneo.mapping.fetch_containment_eagerly">true</prop>
> <prop key="teneo.naming.sql_fk_name_prefix">fk_</prop>
> </props>
> </property>
>
>
> greets
> Flavio
>


--

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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] EMap Table not created [message #754567 is a reply to message #754560] Thu, 03 November 2011 10:27 Go to previous messageGo to next message
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 211
Registered: July 2009
Location: Switzerland
Senior Member
Hi Martin

Thanks for the quick reply, your feeling was right! I didn't notice the errors:

ERROR: org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table [printtemplateset_templates] ([printtemplateset_templates_id] nvarchar(255) null, elt nvarchar(255) null, idx nvarchar(255) not null, primary key ([printtemplateset_templates_id], idx))
ERROR: org.hibernate.tool.hbm2ddl.SchemaUpdate - Eine PRIMARY KEY-Einschränkung kann für eine Spalte in der printtemplateset_templates-Tabelle, die NULL zulässt, nicht definiert werden.
ERROR: org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: alter table [printtemplateset_templates] add constraint FK9F785CD5A2AE9180 foreign key ([printtemplateset_templates_id]) references [printtemplateset]
ERROR: org.hibernate.tool.hbm2ddl.SchemaUpdate - Das printtemplateset_templates-Objekt wurde nicht gefunden, weil es nicht vorhanden ist oder Sie nicht über die entsprechenden Berechtigungen verfügen.

Did I model something wrong?


Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
Re: [Teneo] EMap Table not created [message #754575 is a reply to message #754567] Thu, 03 November 2011 10:58 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I am afraid that you need to help me with the translation..

Can you summarize what the error is?

gr. Martin

On 11/03/2011 11:27 AM, Flavio Donze wrote:
> Hi Martin
>
> Thanks for the quick reply, your feeling was right! I didn't notice the errors:
>
> ERROR: org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table [printtemplateset_templates]
> ([printtemplateset_templates_id] nvarchar(255) null, elt nvarchar(255) null, idx nvarchar(255) not null, primary key
> ([printtemplateset_templates_id], idx))
> ERROR: org.hibernate.tool.hbm2ddl.SchemaUpdate - Eine PRIMARY KEY-Einschränkung kann für eine Spalte in der
> printtemplateset_templates-Tabelle, die NULL zulässt, nicht definiert werden.
> ERROR: org.hibernate.tool.hbm2ddl.SchemaUpdate - Unsuccessful: alter table [printtemplateset_templates] add constraint
> FK9F785CD5A2AE9180 foreign key ([printtemplateset_templates_id]) references [printtemplateset]
> ERROR: org.hibernate.tool.hbm2ddl.SchemaUpdate - Das printtemplateset_templates-Objekt wurde nicht gefunden, weil es
> nicht vorhanden ist oder Sie nicht über die entsprechenden Berechtigungen verfügen.
>
> Did I model something wrong?


--

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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] EMap Table not created [message #754585 is a reply to message #754575] Thu, 03 November 2011 11:57 Go to previous messageGo to next message
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 211
Registered: July 2009
Location: Switzerland
Senior Member
Hi Martin

Sorry I had somehow in mind that you were German.

DE: Eine PRIMARY KEY-Einschränkung kann für eine Spalte in der printtemplateset_templates-Tabelle, die NULL zulässt, nicht definiert werden.

EN: A PRIMARY KEY-restriction can not be set on a column (that allows NULL) in the printtemplateset_templates-table.

DE : Das printtemplateset_templates-Objekt wurde nicht gefunden, weil es nicht vorhanden ist oder Sie nicht über die entsprechenden Berechtigungen verfügen.

EN: The printtemplateset_templates-Object was not found, because it does not exist or you don't have the according access privileges.

Does that make sense?


Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
Re: [Teneo] EMap Table not created [message #754596 is a reply to message #754585] Thu, 03 November 2011 13:02 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Strange, which database is it?

Can you post some of the hbm (related to the emap) to see if it somehow is wrong?

gr. Martin

On 11/03/2011 12:57 PM, Flavio Donze wrote:
> Hi Martin
>
> Sorry I had somehow in mind that you were German.
>
> DE: Eine PRIMARY KEY-Einschränkung kann für eine Spalte in der printtemplateset_templates-Tabelle, die NULL zulässt,
> nicht definiert werden.
>
> EN: A PRIMARY KEY-restriction can not be set on a column (that allows NULL) in the printtemplateset_templates-table.
>
> DE : Das printtemplateset_templates-Objekt wurde nicht gefunden, weil es nicht vorhanden ist oder Sie nicht über die
> entsprechenden Berechtigungen verfügen.
>
> EN: The printtemplateset_templates-Object was not found, because it does not exist or you don't have the according
> access privileges.
>
> Does that make sense?


--

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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] EMap Table not created [message #754617 is a reply to message #754596] Thu, 03 November 2011 14:25 Go to previous messageGo to next message
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 211
Registered: July 2009
Location: Switzerland
Senior Member
Hi Martin

Here my setup:
SQL Server 2008 R2
Hibernate 3.6.2

I believe this is the part:
	<union-subclass name="com.softmodeler.model.impl.PrintTemplateSetImpl" entity-name="PrintTemplateSet" abstract="false" lazy="false" extends="BasicObject" table="`printtemplateset`">
		<meta attribute="eclassName" inherit="false">PrintTemplateSet</meta>
		<meta attribute="epackage" inherit="false">http:///www.softmodeler.com/model/softmodeler/1.0.0</meta>
		<property name="name" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
			<column not-null="false" unique="false" name="`name`"/>
		</property>
		<map name="templates" lazy="false" cascade="all,delete-orphan">
			<key update="true">
				<column name="`printtemplateset_templates_id`" not-null="false" unique="false"/>
			</key>
			<map-key type="java.lang.String"/>
			<element type="java.lang.String"/>
		</map>
	</union-subclass>


greets
Flavio


Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
Re: [Teneo] EMap Table not created [message #754626 is a reply to message #754617] Thu, 03 November 2011 16:01 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Flavio,
The problematic part is this one:
<column name="`printtemplateset_templates_id`" not-null="false" unique="false"/>

not-null="false" seems indeed strange for a key column.

The current code explicitly sets it to nullable, I removed that code and am doing a rebuild.

This is the related issue I entered for it:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=362812

gr. Martin

On 11/03/2011 03:25 PM, Flavio Donze wrote:
> Hi Martin
>
> Here my setup:
> SQL Server 2008 R2
> Hibernate 3.6.2
>
> I believe this is the part:
>
> <union-subclass name="com.softmodeler.model.impl.PrintTemplateSetImpl" entity-name="PrintTemplateSet" abstract="false"
> lazy="false" extends="BasicObject" table="`printtemplateset`">
> <meta attribute="eclassName" inherit="false">PrintTemplateSet</meta>
> <meta attribute="epackage" inherit="false">http:///www.softmodeler.com/model/softmodeler/1.0.0</meta>
> <property name="name" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
> <column not-null="false" unique="false" name="`name`"/>
> </property>
> <map name="templates" lazy="false" cascade="all,delete-orphan">
> <key update="true">
> <column name="`printtemplateset_templates_id`" not-null="false" unique="false"/>
> </key>
> <map-key type="java.lang.String"/>
> <element type="java.lang.String"/>
> </map>
> </union-subclass>
>
>
> greets
> Flavio


--

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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] EMap Table not created [message #754632 is a reply to message #754626] Thu, 03 November 2011 16:48 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
The new build has been published, let me know if it solves it for you.

gr. Martin

On 11/03/2011 05:01 PM, Martin Taal wrote:
> Hi Flavio,
> The problematic part is this one:
> <column name="`printtemplateset_templates_id`" not-null="false" unique="false"/>
>
> not-null="false" seems indeed strange for a key column.
>
> The current code explicitly sets it to nullable, I removed that code and am doing a rebuild.
>
> This is the related issue I entered for it:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=362812
>
> gr. Martin
>
> On 11/03/2011 03:25 PM, Flavio Donze wrote:
>> Hi Martin
>>
>> Here my setup:
>> SQL Server 2008 R2
>> Hibernate 3.6.2
>>
>> I believe this is the part:
>>
>> <union-subclass name="com.softmodeler.model.impl.PrintTemplateSetImpl" entity-name="PrintTemplateSet" abstract="false"
>> lazy="false" extends="BasicObject" table="`printtemplateset`">
>> <meta attribute="eclassName" inherit="false">PrintTemplateSet</meta>
>> <meta attribute="epackage" inherit="false">http:///www.softmodeler.com/model/softmodeler/1.0.0</meta>
>> <property name="name" lazy="false" insert="true" update="true" not-null="false" unique="false" type="java.lang.String">
>> <column not-null="false" unique="false" name="`name`"/>
>> </property>
>> <map name="templates" lazy="false" cascade="all,delete-orphan">
>> <key update="true">
>> <column name="`printtemplateset_templates_id`" not-null="false" unique="false"/>
>> </key>
>> <map-key type="java.lang.String"/>
>> <element type="java.lang.String"/>
>> </map>
>> </union-subclass>
>>
>>
>> greets
>> Flavio
>
>


--

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@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [Teneo] EMap Table not created [message #754757 is a reply to message #754632] Fri, 04 November 2011 08:37 Go to previous message
Flavio Donze is currently offline Flavio DonzeFriend
Messages: 211
Registered: July 2009
Location: Switzerland
Senior Member
Hi Martin

This solves the issue, table is being created and I can store objects.

Thanks a lot!
Flavio


Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
Previous Topic:[Announce] Texo generates JPA Annotated Source Code
Next Topic:export from xml to EMF possibilities
Goto Forum:
  


Current Time: Sat Nov 28 15:03:23 GMT 2020

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

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

Back to the top