Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hi,
I've a problem.
I'm starting to use hibernate annotation.
I downloaded hibernate core 3 and hibernate annotation libraries.
I have the follow file and the follow class:
hibernate.cfg.xml
..
<session-factory>
<property
name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.connection.url">jdbc:hsqldb:file:C:/database/test.db</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="connection.pool_size">1</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property> -->
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="show_sql">true</property>
<property name="hibernate.cache.provider_class">
org.hibernate.cache.HashtableCacheProvider
</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping package="services"/>
<mapping class="services.User"/>
</session-factory>
User.java
package services;
import javax.persistence.Id;
import javax.persistence.Column;
import javax.persistence.Entity;
@Entity
public class User {
@Id
@Column(name="CODE_USER")
private String id;
@Column private String name;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
.......
when it runs HibernateUtil.java at line:
Annotation a = new Annotation();
it throws this error:
java.lang.StackOverflowError
null
null
null
Can you help me!!?!!
thanks