-
1. Re: IdentifierStrategy issue with non-entity classes
zergspirit Sep 8, 2008 2:31 PM (in response to zergspirit)I up this one, since I still couldn't figure out what's wrong here.
-
2. Re: IdentifierStrategy issue with non-entity classes
shane.bryzak Sep 8, 2008 11:07 PM (in response to zergspirit)The identifier strategy is intended to generate unique ID's for specific object instances. For entities this is easy because they are required to have an @Id field. For non entity classes, you need to develop your own identifier strategy which returns an identifier based on some unique aspect of your object instance.
TestClass
isn't a unique identifier, as it doesn't distinguish between two individual instances of the TestClass class. -
3. Re: IdentifierStrategy issue with non-entity classes
gaboo.gael.livre-rare-book.com Sep 9, 2008 11:03 AM (in response to zergspirit)From the seam 2.1 documentation :
15.6.10.3.6. ClassIdentifierStrategy This identifier strategy is used to generate unique identifiers for classes, and will use the value of the name (if specified) in the @Identifier annotation. If there is no name property provided, then it will attempt to use the component name of the class (if the class is a Seam component), or as a last resort it will create an identifier based on the name of the class (excluding the package name). For example, the identifier for the following class will be "customer": @Identifier(name = "customer") public class Customer {
So there is something I don't get, because as I understand the documentation, it should generate a target name from the class ... ? Or what is this for ?
-
4. Re: IdentifierStrategy issue with non-entity classes
shane.bryzak Sep 9, 2008 11:19 AM (in response to zergspirit)That's correct, if you are passing in a Class. In your example though, you pass in an object instance (new TestClass()), not a Class instance.
-
5. Re: IdentifierStrategy issue with non-entity classes
gaboo.gael.livre-rare-book.com Sep 9, 2008 11:23 AM (in response to zergspirit)Well, thanks, this is what we're looking for !
I think it could be more clear in the documentation though :)