[TENEO] @GenericGenerator(name="hibseq", strategy = "hilo"... [message #425364] |
Sat, 22 November 2008 17:27 |
Liviu-Marian Negrila 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=" 
@GenericGenerator(name="system-uu id", strategy = "uuid")
@GenericGenerator (name="hibseq", strategy = "hilo",
 parameters = {
 @Parameter(name="table", value = "hilo_table"),
 @Parameter(name="column", value="the_hilo_column")
 }
)
		"/>
</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="
				@Id @GeneratedValue(generator="hibseq")&#x D;
			 "/>
</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 #425377 is a reply to message #425367] |
Sun, 23 November 2008 06:52 |
Martin Taal 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
|
|
|
Powered by
FUDForum. Page generated in 0.04228 seconds