Bonjour,

je veux récupérer des données dont certaines sont de type Timestamp en base. Le problème est que j'obtiens l'exception :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
[17:37:03,312 ] DEBUG org.hibernate.util.JDBCExceptionReporter - could not execute query [SELECT DNAME, DFULLNAME, DUSERARRIVEDATE, DUSERCHANGEDATE FROM USERS , USERSECURITYATTRIBUTES WHERE USERS.DNAME=USERSECURITYATTRIBUTES.DUSERNAME AND USERSECURITYATTRIBUTES.DATTRIBUTETYPE='role' AND USERSECURITYATTRIBUTES.DATTRIBUTENAME='PubAdmin']
java.sql.SQLException: ORA-03115: type de réseau ou représentation non pris en compte
	at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
	at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
...
[17:37:03,343 ] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 3115, SQLState: 63000
[17:37:03,359 ] ERROR org.hibernate.util.JDBCExceptionReporter - ORA-03115: type de réseau ou représentation non pris en compte
Mon mapping est le suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
	<class name="PublicateurBean" table="USERS" >
		<id name="nom" type="string">
            <column name="DNAME" length="50" />
            <generator class="assigned" />
        </id>
        <property name="nomComplet" type="string">
            <column name="DFULLNAME" length="50" />
        </property>
        <property name="dateCreation" type="timestamp">
            <column name="DUSERARRIVEDATE" length="11" />
        </property>
        <property name="dateDerniereUtilisation" type="timestamp">
            <column name="DUSERCHANGEDATE" length="11" />
        </property>
</class>
mon bean :
Code : 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
public class PublicateurBean implements java.io.Serializable
{
	private String nom;
	private String nomComplet;
	private List<RoleBean> listRoles;
	private List<String> listCompte;
	private Date dateCreation;
	private Date dateDerniereUtilisation;
	private int nbDocs;
 
 
	public PublicateurBean() {
		super();
	}
 
	public String getNom() 
	{
		return nom;
	}
 
	public void setNom(String nom) 
	{
		this.nom = nom;
	}
 
	public String getNomComplet() 
	{
		return nomComplet;
	}
 
	public void setNomComplet(String nomComplet) 
	{
		this.nomComplet = nomComplet;
	}
 
	public List<RoleBean> getListRoles() 
	{
		return listRoles;
	}
 
	public void setListRoles(List<RoleBean> listRoles) 
	{
		this.listRoles = listRoles;
	}
 
	public List<String> getListCompte() {
		return listCompte;
	}
 
	public void setListCompte(List<String> listCompte) {
		this.listCompte = listCompte;
	}
 
	public Date getDateCreation() 
	{
		return dateCreation;
	}
 
	public void setDateCreation(Date dateCreation) 
	{
		this.dateCreation = dateCreation;
	}
 
	public Date getDateDerniereUtilisation() 
	{
		return dateDerniereUtilisation;
	}
 
	public void setDateDerniereUtilisation(Date dateDerniereUtilisation) 
	{
		this.dateDerniereUtilisation = dateDerniereUtilisation;
	}
}
et la récupération des données :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
listPublicateur = this.getSession().createSQLQuery("SELECT DNAME, DFULLNAME, DUSERARRIVEDATE, DUSERCHANGEDATE FROM USERS , USERSECURITYATTRIBUTES WHERE USERS.DNAME=USERSECURITYATTRIBUTES.DUSERNAME AND USERSECURITYATTRIBUTES.DATTRIBUTETYPE='role' AND USERSECURITYATTRIBUTES.DATTRIBUTENAME='" + role.getNom()+"'").addEntity(PublicateurBean.class).list();
Quand je supprime les 2 champs de type date de mon mapping et de ma requête ça fonctionne bien.
Je n'y comprends rien