Hi list,

I'm new to this list, and actually quite new to hibernate too, so maybe this has been discussed or done before... I did not find a trace of it, though ;)

While looking for a way to persist my enums, I figured that the best way to go by now would be to
- use jdk1.5's enums
- have hibernate know about these.


Since there apparently isn't a native type for jdk1.5 enums yet, I started writing a UserType implementation for it. After some fiddling around, I came out with something that seems to be working, at least for me.
I did not implement it as a "native" hibernate type, simply because it's more convenient as a user to use UserType, so as to not have to keep up a parallel hibernate build... but I suppose it would be safer and/or stronger to have this implemented the "native" way.


Anyway, I wanted to share this with you guys, so if anyone's interested, you can find a zip file here with source and testcases:
https://swaf.dev.java.net/temp/swaf-tools-hibernate.zip
You can also view it on cvs here: https://swaf.dev.java.net/source/browse/swaf/swaf-tools/hibernate/


Of course, you'll need a jdk1.5 to build it.

Please let me know what you think.



greg


ps: I'm actually wondering why the "native" Type and UserType interfaces are two different things?



------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to