Dear Anurag,

I 'cc' to the list my reply to your question so that others can speak out their 
experience with this topic.
The topic is covered by JIRA issue HB-27 
(http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-27) 
where you can find the discussion about it.

Actually I'm using hibernate 2.0.5 with this patch and it works fine. The problem, as 
Gavin says in JIRA, is that these kind of mappings for enum fields make the domain 
model to depend on the persistent layer. That is, a persistent class must import an 
interface defined in the hibernate package. This approach should be avoided in order 
to follow an elegant separation between the two.
That's why the issue is open and I don't know if my (and Chriss Webb's) patch will be 
part of the official release.
By the way, is there anyone who knows how other O/R mapping tools deal with this?

An obvious alternative could be to write a CustomType for each enum (that is 
annoying), or, maybe, a sort of AbstractCustomEnumType that one can extend declaring 
just the actual values mapping for each enumeration.
If I had the time I could try to submit such implementation to the comminity. In the 
meantime, you can apply the PersistentStringEnum patch with the file attached in JIRA.

stefano


-----Messaggio originale-----
Da: Anurag Goel [mailto:[EMAIL PROTECTED]
Inviato: mercoledì 22 ottobre 2003 20.24
A: Travelli Stefano
Oggetto: Hibernate Persistent Enum


Stefano,

I noticed you had developed a Persistent String Enum interface for Hibernate, to deal 
with String based enumerations - I want to find out if it is still under development, 
and if and when it will be part of the official release ?

Thanks,
-Anurag



Do you Yahoo!?
The New Yahoo! Shopping - with improved product search


-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to