hbm2java « HBM « JPA Q&A





1. hibernate hbm2hbmxml    stackoverflow.com

I am trying to use ant hibernatetool task to generate hbm.xml files from my db schema in mysql. ant task runs without errors but no hbm.xml files are generated. What am ...

2. Hibernate hbm2java in Netbeans    forums.netbeans.org

I'm developing a project using Hibernate and an existing DB. After some reading and testing (I'm new to Hibernate), I decided to implement the following development flow: 1) Generate all hbm ...

4. Problem using Hibernate Extensions: hbm2java    coderanch.com

Hello again, I am a Hibernate newbie... Have the following jars my Eclipe IDE's build path (of course, I have much much more, but I didn't want to list them all): -hibernate3.jar -hibernate-tools.jar -hibernate-annotations.jar -hibernateconsole.jar -hsqldb.jar (Just downloaded these from SourceForge so they are relatively very new)... Created the following Ant build script:

10. Velocity based renderer for hbm2java now available    forum.hibernate.org

A firstshot at subject is now in CVS of HibernateExt. I've promised it for a looong time, so now it's time to fullfill that promise (unfortunately I'm currently disappointed about how hard it turned out to make a .vm behave just as intelligent as the current renderer - thus the .vm file are not at all complate) But please try it ...

11. hbm2java doesn't work well !    forum.hibernate.org

Setting up batch files it is easy to miss a jar file or something. I would modify your batch file to add jar files in various directories so you don't have to keep modifying your batch files. Add something like: set CLASSPATH= for %%i in (C:\projects\examples\lib\*.jar) do set CLASSPATH=!CLASSPATH!;%1 %%i echo %CLASSPATH% In this case you will have to run cmd.exe ...

12. Problem with equals method from hbm2java    forum.hibernate.org

The equals method gen'd by hbm2java includes the primary key in the equals test. This makes sense for an object that has been persisted. However, it prevents adding several new instances of a class to a set (Map) prior to saving. I have hacked around it by commenting-out the gen'd equals method. How should this be handled?

13. hbm2java throws ClassCastException    forum.hibernate.org

When running hbm2java either by command line or from the Ant task, it throws a ClassCastException whenever I use any tags. I have tried moving a single meta tag to the scope and inside tags and always get the same error. I'm using hibernate 2.1 and I tried the last release of the hibernate-tools and also built it ...

14. Newbie arch. question: hbm2java vs. smart domain model?    forum.hibernate.org

So we are getting rolling with Hibernate in earnest and digging it. We are defining our data model with mapping files and generating everythign else (Java classes and SQL) from the mappings. This is working nicely since it allows us to experiment with mappings (for educational purposes) and see the results both in the Java and in the SQL. The problem, ...

15. Hibernate and hbm2java with JDK 1.5 generics?    forum.hibernate.org

Not sure which forum to post this in, so I'll post it here.... So, is there any idea from anyone whether or when hbm2java will get suppot for the new generics in JDK 1.5 (now publicly out in beta)? I don't know quite what it would look like -- and it'll be a pain getting the syntax right in mapping files ...

16. hbm2java newbie problems    forum.hibernate.org

Hi: I am trying to use hbm2java(hibernate-extensions-2.0.2) with hibernate 2.1. I have a couple of questions : Is it okay to have differentversions for hibernate and hibernate-extensions ? When I invoke hbm2java.bat I get the following error message: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/MultiMap I have commons-collections-2.1.jar in my claspath. any pointers would be greatly appreciated thanks palash





17. Hbm2java and interfaces with implementers    forum.hibernate.org

Given the following mapping file, is there a way to force hbm2java to generate two classes Bar and Baz that implement the interface Foo? I see how I can use META tags to force Foo to be an interface, but when I run hbm2java against the mapping file I get an interface Foo and 2 classes Bar and Baz the extend ...

18. problem executing hbm2java    forum.hibernate.org

Hi: I am tryingto execute hbm2java tool as an ant task.I am using hibernate-2.1, hibernate-extension-2.0.I have generated my hbm files using middlegen-hibernate-r4 plugin and I am getting the following errors : java.lang.NoClassDefFoundError: net/sf/hibernate/MappingException at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145) at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193) at org.apache.tools.ant.Task.perform(Task.java:341) at org.apache.tools.ant.Target.execute(Target.java:309) at org.apache.tools.ant.Target.performTasks(Target.java:336) at org.apache.tools.ant.Project.executeTarget(Project.java:1339) at org.apache.tools.ant.Project.executeTargets(Project.java:1255) at org.apache.tools.ant.Main.runBuild(Main.java:609) at org.apache.tools.ant.Main.start(Main.java:196) at org.apache.tools.ant.Main.main(Main.java:235) at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:149) at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193) ...

19. hbm2java    forum.hibernate.org

Hi guys, I have hard time figuring out how to use mentioned tool and some others (schema export for example). Nothing I download works till I fix classpath issues etc (correct jar filenames etc). Is this "ok" or I have downloaded wrong files? What I need is called here "middle out", ie from hbm to java/ddl. I might need ddl2hbm as ...

20. hbm2java gives NullPointerException    forum.hibernate.org

Dear All, I am new both to java and hibernate, so maybe I overlooked something trivial. hbm2java is so new that google returns only 6 pages .-) I am trying to generate java code from a truly minimal xbm file (see below). I also tried a couple of other xbm files downloaded from various tutorials. My command line is: /tmp> java ...

21. HBM2JAVA with composited PK    forum.hibernate.org

HBM2Java recently has changes in the generation of equals and hash code methods. Now a composite key based class should have theses fields generated. HBM2Java is complaining that it there are no (new) meta tags to tell it to, 1) generate the equals etc, and 2) which fields to use in this process. Thus new meta tags have been introduced, eg, ...

22. log4j.xml and hbm2java    forum.hibernate.org

Hello Fellow Hibernators, I'm using Log4j with a log4j.xml configuration file in my web application. This works fine. I'd like to use that configuration file (below) with Hibernate, but I can't get past this familiar error: Code: codegen: [hbm2java] Processing 1 files. [hbm2java] Building hibernate objects [hbm2java] log4j:WARN No appenders could be found for ...

23. hbm2java and Log4j    forum.hibernate.org

Anyone using hbm2java in an ant task and *not* getting Log4j warning messages? If so, can I see (the relevant parts) of your build.xml? I used hbm2java in my build (the task works; source code created), but for all I've tried, I cannot get Log4j connected. Just completed an experiment starting from Hibernate's distribution files, adding a simple hbm2java task to ...

24. NoCLassDefFoundError in hbm2java    forum.hibernate.org

Beginner Joined: Fri Aug 13, 2004 3:07 pm Posts: 43 Hibernate version: 2.1.6 Hi, I have a slight problem, I am aware that it might be an issue in my build file, but somehow the hbm2java task does not seem to find the MappingException class. Following is the build.xml file and then is the output of running the Code: codegen target. ...

25. How to configure VelocityRenderer with hbm2java    forum.hibernate.org

Tools: Hibernate 2.1.6 with ANT plug-ins for middlgen and hbm2java. Using the hbm2java renderer however the velocity renderer never kicks in. Added the VelocityRenderer to the config.xml but it never appears to kick in. The output is just the standard renderer stuff, never gets to velocity or the vm script. ... ...

26. using hbm2java on nested components    forum.hibernate.org

hbm2java doesn't seem to recurse. As noted in the hibernate documentation, nesting components is not unusual. I can sucessfully use a nested component. My problem arises when I try to use hbm2java. If I use hbm2java on an hbm similar to the one below, it will generate Level1Comp.java, but not Level2Comp.java. If I then pull the Level2Comp component out of the ...

27. typemapping problem in hbm2java    forum.hibernate.org

DataBse: Firebird. I am using MiddleGen to generate HBM files, In a hbm mapping file there is a field 'createtime' of type timestamp . the hbm file for this field looks like when hbm2java utility used to generate java files, the type of this property becomes java.util.Date. Is there anyway to configure hbm2java to ...

28. Can I force hbm2java to create a setId method?    forum.hibernate.org

Hi all, Can I force hbm2java to create a setId method for every hibernate bean? The reason I am asking that is that I need to implement a converter in Java Server Faces. The converter must tranform a object to string and then from the string to create the object. If I cannot create setId which is the alternative solution? Of ...

29. hbm2java difference in Hibernate 2 and Hibernate 3    forum.hibernate.org

Hi, I have a persistent class ObjectA which has a one-to-one reference to ObjectB defined in the ObjectA's mapping file as follows: I use hbm2java to generate source code for the two classes. If I use Hibernate 2.x, everthying goes beautifully: two java files generated. If I use Hibernate 3.0.3, I always get the error ...

30. hbm2java usage    forum.hibernate.org

31. hbm2java and UserTypes    forum.hibernate.org

32. hibernate hbm2java    forum.hibernate.org

I am using the following build script for hibernate tool.... =============== =============================== It works fine.. I want to break it up into 2 steps . Step 1 Generate hbm files ... I am able to do this with "" and removing other entries.. ===============Step 1 =========== ...

33. hbm2java    forum.hibernate.org

34. Hibernate 3 hbm2java    forum.hibernate.org

...

35. hbm2java newline/carriage return/linefeed    forum.hibernate.org

I mean that I my generated Source-code does not have a carriege return at the generated import-statement. So in my VI-editor I see this, package gti.domain.generated;^M ^M import gti.domain.Sjoerd; ^M ^M /**^M * N generated by hbm2java^M */^M ^M public abstract class N implements java.io.Serializable^M {^M ^M As you can see import gti.domain.Sjoerd does not have a ^M (Carraige return). That's ...

36. UserType and hbm2java problem (newbie)    forum.hibernate.org

I'm learning Hibernate (using v 3.0.5) and am trying to implement a UserType as an example. My understanding is that: 1) I first write my custom type "class MyNewClass" 2) I then write a "class MyNewClassType implements UserType" 3) Finally, I map properties using this "wrapper" type, like: I've done this, but after I run hbm2java to generate ...

37. hbm2java issue    forum.hibernate.org

Hibernate version: 3 Mapping documents: I am getting the following message when I try to generate my java using my mapping documents: org.hibernate.MappingException: An association from the table EMAIL_REROUTE_EMPLOYEES refers to an unmapped class: com.encana.admin.common.model.mcdas.McDasPerson Here is my mapping document: Upon the receipt of a ...

38. hbm2java question    forum.hibernate.org

Was reading about this, and am just was wondering how the following situation might work: You have hbm files that you'll generate java files from with hbm2java, then you'll override equals() and hashCode() (and make any other additions to the generated java files), then you'll continue your build process... Is it possible to automate the above in Ant? You could of ...

39. Hbm2Java & custom UserType problem in Hibernate-3    forum.hibernate.org

I went ahead and made the LastModifiedColumnType to extend the java.util.Date but I get these compile errors. I couldnt understood why LMCT is not being considered as Date object. This is how the LMCT looks like: Code: package com.company.hibernate.usertypes; import java.io.Serializable; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; import java.sql.Types; import java.util.Calendar; import java.util.Date; import java.util.Properties; import org.hibernate.HibernateException; import org.hibernate.usertype.UserType; ...

40. hbm2java from java code    forum.hibernate.org

Hey i appreciate if someone could help me with this I'm trying to run hbm2java task from Java code but i got nothing here's the code Project p = new Project( ); p.setBaseDir( new File( "." ) ); HibernateToolTask taskHibernate = new HibernateToolTask( ); taskHibernate.setProject( p ); taskHibernate.setDestDir( new File( PROPERTY_HIBERNATE_XML_GEN_URL_BIN ) ); Path pathAnt = taskHibernate.createClasspath( ); FileSet fs = ...

41. about hbm2java    forum.hibernate.org

Beginner Joined: Sun Aug 13, 2006 8:48 am Posts: 23 Hibernate version: 3.2 I want to know whether hbm2java could build java source when the hbm.xml contains my code like this Code: ...

42. hbm2java and hibernate3    forum.hibernate.org

43. preserving custom code with hbm2java    forum.hibernate.org

44. Where is hbm2java in Hibernate 3    forum.hibernate.org

45. How to invoke hbm2java from a java file.    forum.hibernate.org

Yes it is possible. If you are using an ant build for hbm2java, you can write a simple java code to invoke ant (I have tried it personally). And I guess there is a pure java way to invoke hbm2java without using ant. You have to choose which way to go about.

46. hibernate3 is not able to pick up hbm files for hbm2java    forum.hibernate.org

Hi I am new to hibernate. I am using hibernate 3.3 and trying to make hbm2java work with it. I was able to configure the necessary jar files from this url: http://www.onjava.com/pub/a/onjava/2005 ... tml?page=5 I have my hibernate.cfg.xml in the src/ directory. And i have placed my hbm files in the src/xml/hbm directory. My mapping would look something like this in ...

47. hbm2java no generics, also with jdk5="true"    forum.hibernate.org

Hi, I started using Hibernate 3 with Sun Java(TM) Development Kit (JDK) 6 since last week and I am trying to reverse engineer POJO classes from a MySQL database. I managed to do this, but no generic types are created. I created the following Ant-targets: ...

48. @GeneratedValue and hbm2java    forum.hibernate.org

49. hibernate hbm2java    forum.hibernate.org

Thanks, I figgured this out as well. The primary key isn't really needed For this model. Do all reversed engineered tables need a primary key? This is a simple one-to-many table relationship. You mentioned to show code, what other code is there? The table Sql was provided, and everything else is automated. Threre is no other code to post. Thanks for ...