Hi all,
I tried to implement an application using hibernate.
My class(Entity) is as simple as the following:
Code:
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class Test {
@Id
private int id;
private String name;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
My hibernate.cfg.xml contains the following:
Code:
<property name="hibernate.bytecode.use_reflection_optimizer">true</property>
<property name="hibernate.jdbc.batch_size">50</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.cache.use_query_cache">false</property>
<property name="current_session_context_class">thread</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.use_sql_comments">false</property>
<property name="hibernate.max_fetch_depth">3</property>
<mapping class="de.Test"/>
The hibernate.properties looks like this:
Code:
hibernate.connection.username=postgres
hibernate.connection.password=postgres
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.connection.url=jdbc:postgresql://localhost:5432/test
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
connection.pool_size=3
hibernate.dbcp.validationQuery=SELECT 1+1
When I try to build my session factory I always get this exception:
No identifier specified for entity
Does anyone of you know, what I did wrong...