Hi,
I want to make an update just of a few columns of my table. For this case I took the update clause which was generated by hibernate and reduced it to the fields I need.
Then I put the sql in a @SQLUpdate annotation. The sql is used, but it results in a ORA-01006: bind variable does not exist.
I assume that hibernate tries to put in also the other fields as paramters, but there are enough bind variables.
How can I tell hibernate to just update the fields I want to?
My class:
Code:
@Entity
@Table(name="CERTIFICATES")
@SQLUpdate(sql="update CERTIFICATES set active=?, alias=?, password=?, valid_from=?, valid_till=? where id=?")
public class SchufaCertificate {
@Transient
private Logger log = Logger.getLogger(this.getClass());
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Column(name="active")
private boolean active;
@Temporal(TemporalType.DATE)
@Column(name="valid_from")
private Date validFrom;
@Temporal(TemporalType.DATE)
@Column(name="valid_till")
private Date validTill;
@Column(name ="alias", length=500)
private String alias;
@Column(name ="password", length=50)
private String password;
@Lob
@Column(name = "certificate")
private String certificate = null;
@Transient
private String plainCertificate = null;
@Lob
@Column(name = "privatekey")
private byte[] privatekey = null;
.....