Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Ecore Tools » [Teneo] No primary key in table for multi-valued string attribute
[Teneo] No primary key in table for multi-valued string attribute [message #605473] Tue, 21 September 2010 19:42 Go to next message
Lemao  is currently offline Lemao
Messages: 48
Registered: December 2009
Member
I have an EClass "A" containing a multivalued, EString attribute named "tags". Teneo/Hibernate generate a A_tags table with two columns: an A_tags_id with the A's id and the EString tag.

How can I make sure that this table has a primary key since this needs to be replicated by the underlying db configuration?

Re: [Teneo] No primary key in table for multi-valued string attribute [message #628837 is a reply to message #605473] Fri, 24 September 2010 11:33 Go to previous messageGo to next message
Lemao  is currently offline Lemao
Messages: 48
Registered: December 2009
Member
I found a Teneo property teneo.mapping.map_all_lists_as_idbag that seems relevant , but had no effect on my mappings. After a brief search through the source code, this property seems to be used only for EReference annotations, but in my case I have a multivalued EAttribute

It seems that I would like teneo to generate the following:
<class>
...
     <idbag name="dependentObjects" table="idbag_dependent_objects" lazy="false"> 
       <collection-id column="id" type="java.lang.String"> 
         <generator class="uuid"/> 
       </collection-id> 
       <key column="main_id" /> 
       <element type="java.lang.String" column="val"/> 
     </idbag> 
</class>


Instead of a simple bag with only a FK.

Is that supported? Any ideas on how to get a proper PK generated for this multivalued EAttribute table?

Re: [Teneo] No primary key in table for multi-valued string attribute [message #628855 is a reply to message #605473] Fri, 24 September 2010 13:12 Go to previous message
Lemao  is currently offline Lemao
Messages: 48
Registered: December 2009
Member
Thanks for listening Smile

I resolved the issue by adding an @IdBag(generator="uuid",type="java.lang.String") to my EAttribute.
Previous Topic:Add attribute/reference to diagram which is part of model
Next Topic:How to deploy a generated editor plug-in
Goto Forum:
  


Current Time: Sat Oct 25 21:31:16 GMT 2014

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

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