You are absolutly right, the classes are really poor information. However, they are containing so information that the tables doesn't. For instance, custom types are know only from the class. So the only way to generate a correct mapping for them is to use the class AND the table.
Let say we have a Amnt ( two attributes Amnt.value, Amnt.ccy ). The only was to map it from a Player object to a Player table (two columns: SALARY, SALARY_CCY) is to use link Amnt.value and Amnt.ccy with their appropriate column. With that you will be able to generate: <property name="salary" type="Amnt"> <column name="salary"/> <column name="salary_ccy"/> <property/> BTW, the only way to be sure you map the correct attribute name with the correct column is to have a link between the class and table. We are planning to use my mapping tool to convert all our business classes to hibernate (around 500 classes I think). It wasn't possible to do it with any other tool currently available without editing a lot the final result by hand. I didn't modify class2hbm mainly because there was class2hbm, db2hbm and so I thought a 3rd tool linking class was appropriate to fill a hole. Also I must confess I was too lazy and in a hurry to do the needed refactoring in class2hbm. If you think the goal of my tool reached class2hbm one, I look more into it. Possibly the 3 tools can be merged since mine does the link between the other two. "real file management" : Currently I'm saving the environment using the Preferences API. I think that it's fine until where will be too much .hbm.xml files to put all their paths in the registry. So I'm doing a real file Open, Save, Save as..., Recent files functionality. Henri ----- Original Message ----- From: "Max Rydahl Andersen" <[EMAIL PROTECTED]> To: "Henri Tremblay" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, January 20, 2004 10:05 PM Subject: Re: [Hibernate] Tools > Henri Tremblay wrote: > > > Hello, > > > > At job we have decided to convert our application to Hibernate to > > solve some persistence issues that were previously done by hand > > (caching, lazy loading, outter-join and so on). > > > > An existing application is not really easy to convert but it's going > > pretty well. The first thing that was missing was to be able to create > > hbm.xml files. I tried class2hbm (and improved it a little) but it > > wasn't enough. So on my free time I've started a HbmGenerator that > > creates a hbm.xml file from the class, table and a field mapping > > between both. It currently goes pretty well. I can map normal fields, > > user types (that we use a lot) and tonigh I'll try to add > > associations. So I thought you might be interested to see this app > > (and possibly add it to the hibernate tool set). What do you think? > > Sounds interesting - even though .class files are VERY poor on > information - thus the reason why we don't encourage usage of class2hbm, > because > you almost everytime need to hand-manipulate the generated hbm.xml files. > > But if you have improvements they are more than welcome - still I would > prefer that you could do it by improving class2hbm, but you probably got > some reasons for not to do it ? > > > > > On side of that, I'm also working on hibern8ide. My first improvement > > was to be able to save the configuration so that each time you reopen > > it you don't have to reload everything anymore. My next idea is to add > > auto-completion for the queries and to have real file management. Same > > question, do you want my collaboration on that? > > Sure, add patches to it on the JIRA and we will integrate them. > I must ask, what do you mean by "real file management" ? > > /max > > > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > hibernate-devel mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel