hibernate-tools

How to install Hibernate Tools into Eclipse Luna?

时间秒杀一切 提交于 2019-11-30 22:14:00
问题 I'm using Eclipse Luna, I want to create a web app and use Hibernate for my data. In Eclipse Marketplace I found Hibernate Tools for Indigo or Helios but not for Luna. I found just Red Hat JBoss Developper Studio for Luna ( what's that ?). 回答1: Hibernate Tools is part of JBoss Developer Studio. One option is to install (from Eclipse Marketplace) Red Hat JBoss Developer Studio (Luna) , which will include the entire suite of JBoss tools (including Hibernate Tools). If you just want the

How to configure hibernate-tools with maven to generate hibernate.cfg.xml, *.hbm.xml, POJOs and DAOs

泪湿孤枕 提交于 2019-11-30 05:11:38
can any one tell me how to force maven to precede mapping .hbm.xml files in the automatically generated hibernate.cfg.xml file with package path? My general idea is, I'd like to use hibernate-tools via maven to generate the persistence layer for my application. So, I need the hibernate.cfg.xml, then all my_table_names.hbm.xml and at the end the POJO's generated. Yet, the hbm2java goal won't work as I put *.hbm.xml files into the src/main/resources/package/path/ folder but hbm2cfgxml specifies the mapping files only by table name, i.e.: <mapping resource="MyTableName.hbm.xml" /> So the big

Lazy mapping with hibernate tools?

送分小仙女□ 提交于 2019-11-29 16:20:45
I have two tables A and B in my database. I the table B I have a reference to the table A by an Integer idA . (idA is a foreign key for B) When I do reverse engineering using hibernate-tools, I generate two Java objects. public class A{ int id; } and public class B{ int id; A a; } But I want to have public class B{ int id; int idA; } How can I do this? Thanks, So I found a solution: create a custom ReverseEngineeringStrategy and change the return of excludeForeignKeyAsManytoOne method to true . public class MyReverseEngineeringStrategy extends DelegatingReverseEngineeringStrategy { public

Lazy mapping with hibernate tools?

南笙酒味 提交于 2019-11-28 11:24:58
问题 I have two tables A and B in my database. I the table B I have a reference to the table A by an Integer idA . (idA is a foreign key for B) When I do reverse engineering using hibernate-tools, I generate two Java objects. public class A{ int id; } and public class B{ int id; A a; } But I want to have public class B{ int id; int idA; } How can I do this? Thanks, 回答1: So I found a solution: create a custom ReverseEngineeringStrategy and change the return of excludeForeignKeyAsManytoOne method to

How to configure hbm2java and hbm2dao to add packagename to generated classes

自作多情 提交于 2019-11-28 07:05:38
I'm trying to configure hbm2java with maven to generate POJO classes and DAO objects. One of the issues I'm dealing with is package names aren't generated. I'm using the following pom for that: <execution> <id>hbm2java</id> <phase>generate-sources</phase> <goals> <goal>hbm2java</goal> </goals> <inherited>false</inherited> <configuration> <components> <component> <name>hbm2java</name> <implementation>configuration</implementation> </component> </components> <componentProperties> <packagename>package.name</packagename> <configurationfile>target/hibernate3/generated-mappings/hibernate.cfg.xml<

How to configure hbm2java and hbm2dao to add packagename to generated classes

别来无恙 提交于 2019-11-27 01:47:36
问题 I'm trying to configure hbm2java with maven to generate POJO classes and DAO objects. One of the issues I'm dealing with is package names aren't generated. I'm using the following pom for that: <execution> <id>hbm2java</id> <phase>generate-sources</phase> <goals> <goal>hbm2java</goal> </goals> <inherited>false</inherited> <configuration> <components> <component> <name>hbm2java</name> <implementation>configuration</implementation> </component> </components> <componentProperties> <packagename

How to install Hibernate Tools in Eclipse?

江枫思渺然 提交于 2019-11-26 21:20:58
What is the proper way to install Hibernate Tools in Eclipse as a plugin? The Hibernate site doesn't really give any instructions. Looking at the Hibernate Tools binary HibernateTools-3.2.4.Beta1-R200810311334.zip , it appears that I can just unzip this in my eclipse directory. Do I just unzip it in my eclipse directory? This seems like a hacky was to install it. Well, most convenient and safest way is to use JBoss update site within Eclipse software updates (Help -> Software Updates... -> Add Site...): The latest stable release update site for JBoss Tools There you can find Hibernate tools