Bonjour,

J'utiline hibernate avec MSSQL 2008.

J'ai l'erreur suivante sur @Entity :

This mapped class is not contained in any persistence unit
Cela dit, mon code fonctionne très bien mais j'aimerai tout de même l'enlever...

Voici mon fichier de config hibernate :

Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
	<session-factory>
		<!-- Database connection settings -->
		<property name="connection.driver_class">
			net.sourceforge.jtds.jdbc.Driver
		</property>
		<property name="connection.url">
			jdbc:jtds:sqlserver://XXX-PC/db_java;instance=SQLEXPRESS 
		</property>
		<property name="connection.username">X</property>
		<property name="connection.password">X</property>
		<property name="dialect">
			org.hibernate.dialect.SQLServerDialect
		</property>
 
		<!--
			Enable c3p0 connection pooling, because hibernate pooling is not
			prod-ready. Apparently connection.provider_class is needed in
			hibernate 3+
		-->
		<property name="connection.provider_class">
			org.hibernate.connection.C3P0ConnectionProvider
		</property>
		<!-- configuration pool via c3p0-->
		<property name="hibernate.c3p0.min_size">5</property>
		<property name="hibernate.c3p0.max_size">20</property>
		<property name="hibernate.c3p0.timeout">300</property>
		<property name="hibernate.c3p0.max_statements">50</property>
 
		<!-- Echo all executed SQL to stdout for debugging -->
		<property name="show_sql">true</property>
		<!-- All the entity classes for hibernate to check for annotations here -->
		<mapping class="DataObjectLayer.Event" />
		<mapping class="DataObjectLayer.Person" />
	</session-factory>
</hibernate-configuration>

J'ai vu sur internet l'existence du fichier : persistence.xml
Cependant si j'utilise hibernante, je n'en ai pas besoin non ?

Merci de votre aide,
S