Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GenericMark in generated code is null

 
Joao Cunha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I'm studing about hibernate by the Hibernate 3 tutorial. I also installed the hibernate synchronizer 3.1.1 in my eclipse (3.1.2 with java 1.5) in order to facilitate the code gen.

However I'm facing some problems working with collections and bi-directional links in hibernate_synchronizer (hbm2java).

I set a collection on hbm.xml file according to hibernate 3 tutorial and the code has not been created correctly:
Code:

Then I invoked the "Synchronize Files" command of hibernate synchronizer and the base vo was generated with error:
Code:

The "<null>" should be "<String>"

This problem is happening to any wrapper object. I'd alread tried to lok for the snippets but I don't have a clue.

Thanks!
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"string"

Shouldn't that be with a capital "S" as in "String"?

Mark
 
Joao Cunha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I've already tried to put string, String, java.lang.String, Text, varchar as type and none of these worked.

I don't know if the problem is in the hibernate synchronizer plugin or on the hbm2java.jar!

What do you sugest?

Thanks!
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm no pro at all, so is just a guess, but i checked my own hbms (H2) and also this DTD http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd
there you'll find:
<!ELEMENT set (
meta*,
(cache|jcs-cache)?,
key,
(element|one-to-many|many-to-many|composite-element|many-to-any)
)>
so what i mean is that it seems you cant have column twice...
[ March 27, 2006: Message edited by: miguel lisboa ]
 
Joao Cunha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I've tried to change the xml, but there was no result.
I'm thinking that there is a problem with the version of hbm2java I'm using.
I'm using hibernate 3 with java 5... the code generated by hbm2java is working correctly to relational objects (the generic marker is generated correcly with the '<class>' code), but not with the wrappers (Long, Boolean, String, ...)

Are there a place where I can find the source code of hbm2java?
Or even a description about this library?

Thanks!
 
Joao Cunha
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have someone faced and solved this problem?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic