I am trying to persist a testcase with derby (embedded). The code looks like:
Code:
@Id
@GeneratedValue(strategy= GenerationType.AUTO)
private Long Id;
private String message;
public DerbyHibernateLobTestcase() {
}
public Long getId() {
return Id;
}
public void setId(Long id) {
Id = id;
}
@Lob
@Column(length=1000)
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
and the log message for creating the table is
Code:
DEBUG SchemaExport - Unsuccessful: drop table hibernate_unique_key
DEBUG SchemaExport - 'DROP TABLE' cannot be performed on 'HIBERNATE_UNIQUE_KEY' because it does not exist.
DEBUG SchemaExport -
create table DerbyHibernateLobTestcase (
Id bigint not null,
message varchar(255),
primary key (Id)
)
DEBUG SchemaExport -
create table hibernate_unique_key (
next_hi integer
)
DEBUG SchemaExport -
insert into hibernate_unique_key values ( 0 )
INFO SchemaExport - schema export complete
The "length" attribute is completely ignored. In fact if I remove the @Lob annotation and replace the annotation with
Code:
@Column(columnDefinition="varchar(1000)")
I
still get a varchar(255) column. In fact even if I write
Code:
@Column(columnDefinition="foobar")
I still get a varchar(255) column.
I'm using hibernate core 3.3.2 with annotation 3.4.0.