Bonjour,
Voici une classe générée par hibernate afin de manipuler ma bdd :
Le problème est que je n'arrive pas (via la méthode setDetail) à initialiser la variable "detail" de type Clob avec par exemple la valeur "toto".
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 import java.sql.Clob; import javax.persistence.AttributeOverride; import javax.persistence.AttributeOverrides; import javax.persistence.Column; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.Table; /** * Payment generated by hbm2java */ @Entity @Table(name = "Payment", catalog = "CSD") public class Payment implements java.io.Serializable { private PaymentId id; private Clob detail; public Payment() { } public Payment(PaymentId id) { this.id = id; } public Payment(PaymentId id, Clob detail) { this.id = id; this.detail = detail; } @EmbeddedId @AttributeOverrides({ @AttributeOverride(name = "remiseId", column = @Column(name = "RemiseId", nullable = false, precision = 18, scale = 0)), @AttributeOverride(name = "ppeId", column = @Column(name = "PpeId", nullable = false, precision = 18, scale = 0)) }) public PaymentId getId() { return this.id; } public void setId(PaymentId id) { this.id = id; } @Column(name = "Detail") public Clob getDetail() { return this.detail; } public void setDetail(Clob detail) { this.detail = detail; } }
Dans ma bdd (MSSQL), la zone "détail" est de type nvarchar, donc susceptible de contenir du texte.
Merci pour votre aide.
Partager