Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EJB3 annotations
EJB3 annotations [message #50607] Fri, 15 September 2006 06:09 Go to next message
Eclipse UserFriend
Originally posted by: xkamlesh.yahoo.com

How do I get ASSIGNED attribute for ID generator class like

<id name="id" type="java.lang.String" column="'id'">
<generator class="assigned">
</generator>
</id>

I use EJB3 Column annotation. It works for AUTO generator but for ASSIGNED
it
throws the following exception.

SEVERE: Error setting feature 'strategy' [Cannot convert 'ASSIGNED' to
'GenerationType' type] annotation: http://ejb.elver.org/GeneratedValue
Re: EJB3 annotations [message #50631 is a reply to message #50607] Fri, 15 September 2006 07:08 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Kamlesh,
Afaik assigned is the default strategy if no generator is specified (for hibernate).

Assigned is a hibernate specific value which is not part of the ejb3 spec.

In the latest teneo version you can specify hibernate specific generators:
If you want to use hibernate specific generators then you should use the GenericGenerator annotation
(for more info see the Hibernate Annotation Extensions).

As an example this annotation should be placed at package level in an eannotation (using the source:
teneo.jpa):
@GenericGenerator(name="hibseq", strategy = "hilo",
parameters = {
@Parameter(name="table", value = "hilo_table"),
@Parameter(name="column", value="the_hilo_column")
}
)

and then in the id field this annotation can be used (specified in an eannotation with source
teneo.jpa):
@Id @GeneratedValue(generator="hibseq")

Instead of eannotations you can also specify the annotations in a separate xml file.

gr. Martin

Kamlesh wrote:
> How do I get ASSIGNED attribute for ID generator class like
>
> <id name="id" type="java.lang.String" column="'id'">
> <generator class="assigned">
> </generator>
> </id>
>
> I use EJB3 Column annotation. It works for AUTO generator but for
> ASSIGNED it
> throws the following exception.
>
> SEVERE: Error setting feature 'strategy' [Cannot convert 'ASSIGNED' to
> 'GenerationType' type] annotation: http://ejb.elver.org/GeneratedValue
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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: EJB3 annotations [message #591164 is a reply to message #50607] Fri, 15 September 2006 07:08 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Kamlesh,
Afaik assigned is the default strategy if no generator is specified (for hibernate).

Assigned is a hibernate specific value which is not part of the ejb3 spec.

In the latest teneo version you can specify hibernate specific generators:
If you want to use hibernate specific generators then you should use the GenericGenerator annotation
(for more info see the Hibernate Annotation Extensions).

As an example this annotation should be placed at package level in an eannotation (using the source:
teneo.jpa):
@GenericGenerator(name="hibseq", strategy = "hilo",
parameters = {
@Parameter(name="table", value = "hilo_table"),
@Parameter(name="column", value="the_hilo_column")
}
)

and then in the id field this annotation can be used (specified in an eannotation with source
teneo.jpa):
@Id @GeneratedValue(generator="hibseq")

Instead of eannotations you can also specify the annotations in a separate xml file.

gr. Martin

Kamlesh wrote:
> How do I get ASSIGNED attribute for ID generator class like
>
> <id name="id" type="java.lang.String" column="'id'">
> <generator class="assigned">
> </generator>
> </id>
>
> I use EJB3 Column annotation. It works for AUTO generator but for
> ASSIGNED it
> throws the following exception.
>
> SEVERE: Error setting feature 'strategy' [Cannot convert 'ASSIGNED' to
> 'GenerationType' type] annotation: http://ejb.elver.org/GeneratedValue
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
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:EJB3 annotations
Next Topic:OCL help needed
Goto Forum:
  


Current Time: Mon Jul 15 21:16:12 GMT 2024

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

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

Back to the top