Cameron McKenzie wrote:
Well, Hibernate is really just about object-relational mappings. So, the idea is to just create your Java classes as you normally would, and then map them. There's really no need to complicate things beyond that.
Hello;
Thanks fro the note. I know I am supposed to create my 'usual' java classes. But look at my example here:
I have a class that has a member imageFile which is of type java.awt.File. I tried to create a component for the File class in my class but it gave me an error later telling me that java.io.File does not implement a no-arg constructor. I created a dummy class named File with the same attributes but provided a default constructor, this time; I had two options:
I was able to use the <component> sub element of my class mapping
I was able to Create a user type implementation that extends UserType and used that type instead of <component>
So, my question is where to use which? Except for classes that you don't own the source and do not have no-arg, what are the pros and cons of using one not the other?
Kamal