Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [TENEO] @GenericGenerator(name="hibseq", strategy = "hilo"...
[TENEO] @GenericGenerator(name="hibseq", strategy = "hilo"... [message #425364] Sat, 22 November 2008 17:27 Go to next message
Liviu-Marian Negrila is currently offline Liviu-Marian NegrilaFriend
Messages: 53
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------080206000302080307030300
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Hello,

I would like to have a single interface (say IPersistable) that would
declare the 'myid' attribute that would be a primary key in all tables
(for all entities) that implement this interface.

All is good, but:

- there is a single 'hilo_table' with a single 'the_hilo_column' with a
single ligne for all entities (I undestand this is the hi value of the
algorith)

- hence I suspect that no two tables (entities) would have the same myid
and I would like to have the myid unique only within a table and not
across the whole package.

- it would probaly run out of "id space" a lot quicker for an app with a
lot of entities

Questions:
- what can I do to keep the interface and have each table have its own
line in the hilo_table?

- how can set the value of the size of the "id buffer" to 1? I undersand
that there is a value that controls how often it will update the hilo
table - it is this value I want to put to 1 in order to connect multiple
hibernate clients to the same database

Please advice,
Liviu

--------------080206000302080307030300
Content-Type: text/xml;
name="spadcore.ecore"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="spadcore.ecore"

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="spadcore"
nsURI="http://www.spad.ro/spadcore" nsPrefix="spadcore">
<eAnnotations source="teneo.hibernate">
<details key="appinfo" value=" &#xD;&#xA;@GenericGenerator(name=&quot;system-uu id&quot;, strategy = &quot;uuid&quot;)&#xD;&#xA;@GenericGenerator (name=&quot;hibseq&quot;, strategy = &quot;hilo&quot;,&#xD;&#xA; parameters = {&#xD;&#xA; @Parameter(name=&quot;table&quot;, value = &quot;hilo_table&quot;),&#xD;&#xA; @Parameter(name=&quot;column&quot;, value=&quot;the_hilo_column&quot;)&#xD;&#xA; }&#xD;&#xA;)&#xD;&#xA;&#x9;&#x9;"/>
</eAnnotations>
<eClassifiers xsi:type="ecore:EClass" name="IPersistable" abstract="true" interface="true">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="IPersistable"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="myid" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Long"
unsettable="true">
<eAnnotations source="teneo.hibernate">
<details key="appinfo" value="&#xD;&#xA;&#x9;&#x9;&#x9;&#x9;@Id @GeneratedValue(generator=&quot;hibseq&quot;)&#x D;&#xA;&#x9;&#x9;&#x9; "/>
</eAnnotations>
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="myid"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Patient" eSuperTypes="#//IPersistable">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="User" eSuperTypes="#//IPersistable">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="someAttribute" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>

--------------080206000302080307030300--
Re: [TENEO] @GenericGenerator(name="hibseq", strategy = "hilo"... [message #425365 is a reply to message #425364] Sat, 22 November 2008 17:32 Go to previous messageGo to next message
Liviu-Marian Negrila is currently offline Liviu-Marian NegrilaFriend
Messages: 53
Registered: July 2009
Member
Please note there is an attachment in the previous message.

The solution I would hope to find would be to put some parameter on the
IPersistable interface that would make the Generator take the name of
the actual table to persist and use this as a key to find the hilovalue
in the hilotable.

All suggestions are welcome
Liviu

Liviu wrote:
> Hello,
>
> I would like to have a single interface (say IPersistable) that would
> declare the 'myid' attribute that would be a primary key in all tables
> (for all entities) that implement this interface.
>
> All is good, but:
>
> - there is a single 'hilo_table' with a single 'the_hilo_column' with a
> single ligne for all entities (I undestand this is the hi value of the
> algorith)
>
> - hence I suspect that no two tables (entities) would have the same myid
> and I would like to have the myid unique only within a table and not
> across the whole package.
>
> - it would probaly run out of "id space" a lot quicker for an app with a
> lot of entities
>
> Questions:
> - what can I do to keep the interface and have each table have its own
> line in the hilo_table?
>
> - how can set the value of the size of the "id buffer" to 1? I undersand
> that there is a value that controls how often it will update the hilo
> table - it is this value I want to put to 1 in order to connect multiple
> hibernate clients to the same database
>
> Please advice,
> Liviu
>
Re: [TENEO] @GenericGenerator(name="hibseq", strategy = "hilo"... [message #425367 is a reply to message #425365] Sat, 22 November 2008 18:16 Go to previous messageGo to next message
Liviu-Marian Negrila is currently offline Liviu-Marian NegrilaFriend
Messages: 53
Registered: July 2009
Member
I got lucky with my second question for setting the hilo value:
I suppose something like this would work.
@Parameter(name="max_lo", value = "5")

Yet I would like some confirmation for the scenario: one database and
multiple teneo/hibernate rcp clients.

For the first question I'm still searching but expect no luck...
(what can I do to keep the interface and have each table have its own
line in the hilo_table?)

Liviu

Liviu wrote:
> Please note there is an attachment in the previous message.
>
> The solution I would hope to find would be to put some parameter on the
> IPersistable interface that would make the Generator take the name of
> the actual table to persist and use this as a key to find the hilovalue
> in the hilotable.
>
> All suggestions are welcome
> Liviu
>
> Liviu wrote:
>> Hello,
>>
>> I would like to have a single interface (say IPersistable) that would
>> declare the 'myid' attribute that would be a primary key in all tables
>> (for all entities) that implement this interface.
>>
>> All is good, but:
>>
>> - there is a single 'hilo_table' with a single 'the_hilo_column' with a
>> single ligne for all entities (I undestand this is the hi value of the
>> algorith)
>>
>> - hence I suspect that no two tables (entities) would have the same myid
>> and I would like to have the myid unique only within a table and not
>> across the whole package.
>>
>> - it would probaly run out of "id space" a lot quicker for an app with a
>> lot of entities
>>
>> Questions:
>> - what can I do to keep the interface and have each table have its own
>> line in the hilo_table?
>>
>> - how can set the value of the size of the "id buffer" to 1? I undersand
>> that there is a value that controls how often it will update the hilo
>> table - it is this value I want to put to 1 in order to connect multiple
>> hibernate clients to the same database
>>
>> Please advice,
>> Liviu
>>
Re: [TENEO] @GenericGenerator(name="hibseq", strategy = "hilo"... [message #425377 is a reply to message #425367] Sun, 23 November 2008 06:52 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Liviu,
I replied to your other post. It seems that that also answers this thread. If not, let me know.

gr. Martin

Liviu wrote:
> I got lucky with my second question for setting the hilo value:
> I suppose something like this would work.
> @Parameter(name="max_lo", value = "5")
>
> Yet I would like some confirmation for the scenario: one database and
> multiple teneo/hibernate rcp clients.
>
> For the first question I'm still searching but expect no luck...
> (what can I do to keep the interface and have each table have its own
> line in the hilo_table?)
>
> Liviu
>
> Liviu wrote:
>> Please note there is an attachment in the previous message.
>>
>> The solution I would hope to find would be to put some parameter on the
>> IPersistable interface that would make the Generator take the name of
>> the actual table to persist and use this as a key to find the hilovalue
>> in the hilotable.
>>
>> All suggestions are welcome
>> Liviu
>>
>> Liviu wrote:
>>> Hello,
>>>
>>> I would like to have a single interface (say IPersistable) that would
>>> declare the 'myid' attribute that would be a primary key in all tables
>>> (for all entities) that implement this interface.
>>>
>>> All is good, but:
>>>
>>> - there is a single 'hilo_table' with a single 'the_hilo_column' with a
>>> single ligne for all entities (I undestand this is the hi value of the
>>> algorith)
>>>
>>> - hence I suspect that no two tables (entities) would have the same myid
>>> and I would like to have the myid unique only within a table and not
>>> across the whole package.
>>>
>>> - it would probaly run out of "id space" a lot quicker for an app with a
>>> lot of entities
>>>
>>> Questions:
>>> - what can I do to keep the interface and have each table have its own
>>> line in the hilo_table?
>>>
>>> - how can set the value of the size of the "id buffer" to 1? I undersand
>>> that there is a value that controls how often it will update the hilo
>>> table - it is this value I want to put to 1 in order to connect multiple
>>> hibernate clients to the same database
>>>
>>> Please advice,
>>> Liviu
>>>


--

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
Previous Topic:[Teneo] Contained eObject referenced by another eObject?
Next Topic:Show Link under destination and source node
Goto Forum:
  


Current Time: Thu Feb 27 03:18:08 GMT 2020

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

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

Back to the top