[jboss-user] [EJB 3.0] - Customizing the persistence of an embedded object
SmokingAPipe
do-not-reply at jboss.com
Sun Dec 31 04:05:58 EST 2006
Simple question: I have a class that uses an embedded object that's not an entity, like this:
| @Entity
| public class LogMessage {
| private java.util.logging.Level level;
| }
|
Right now, the way that handles it is it creates a bytea column to store the level. Of course that's not what I want. What would be ideal would be to somehow annotate it so I could define my own persistence for that particular field. In this case, I would want to persist it as either an integer or a string perhaps. I know in Hibernate it wasn't a big deal to write my own custom type with its own storage approach but I can't find anything like that in EJB3. Any ideas?
Of course the other thing i can do is to just write up my own enum and not even use the java.util.logging.Level class, but hey, that class is there and does exactly what I want so it would be ideal to use it.
Thanks for any ideas on this
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997031#3997031
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997031
More information about the jboss-user
mailing list