-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Using hibernate tools with hibernate2
PostPosted: Tue Sep 13, 2005 9:53 am 
Newbie

Joined: Mon Sep 12, 2005 9:47 pm
Posts: 4
I try to generate hbm.xml from my class CIngredientes but don't work.

java -cp [classpath] net.sf.hibernate.tool.class2hbm.MapGenerator org.enavarro.lamarinera.hibernate.CIngredientes

Result:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<!-- org.enavarro.lamarinera.hibernate.CIngredientes cannot be added, no UID found! -->
<hibernate-mapping>
</hibernate-mapping>

class2hbm.MapGenerator: executed.

My class:

package org.enavarro.lamarinera.hibernate;

import java.io.Serializable;

/**
* @author Ernesto Navarro Gómez
*/
public class CIngredientes implements Serializable {

private String idIngrediente;
private String nombreIngrediente;

public String getIdIngrediente() {
return idIngrediente;
}

public void setIdIngrediente(String idIngrediente) {
this.idIngrediente = idIngrediente;
}

public CIngredientes() {
}

public CIngredientes(String idIngrediente, String nombreIngrediente) {
this.idIngrediente = idIngrediente;
this.nombreIngrediente = nombreIngrediente;
}

public String getNombreIngrediente() {
return nombreIngrediente;
}

public void setNombreIngrediente(String nombreIngrediente) {
this.nombreIngrediente = nombreIngrediente;
}
}

What is wrong?

Thanks
Ernesto Navarro

PD: Sorry my english


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 8:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The class2hbm is very old and had not been maintain for quite some time. It has been dropped from the H3 tools package. The primary reason is that a class (non-annotated) has limited meta data facilties from which we can generate a reasonable mapping document.

The most common way to deal with this is to use XDoclet (or H3 annotations). The wiki has information on XDoclet (as does xdoclet itself) support for hibernate. There are many examples etc .


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.