-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate Annotations + Derby + Lob = No Joy
PostPosted: Mon Aug 24, 2009 2:47 am 
Newbie

Joined: Tue Sep 26, 2006 1:27 am
Posts: 10
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.


Top
 Profile  
 
 Post subject: Re: Hibernate Annotations + Derby + Lob = No Joy
PostPosted: Wed Sep 09, 2009 7:16 am 
Newbie

Joined: Tue Sep 26, 2006 1:27 am
Posts: 10
No suggestions?


Top
 Profile  
 
 Post subject: Re: Hibernate Annotations + Derby + Lob = No Joy
PostPosted: Tue Sep 15, 2009 5:04 am 
Newbie

Joined: Tue Sep 26, 2006 1:27 am
Posts: 10
Found the answer here:
viewtopic.php?f=9&t=971639&start=0

Not obvious!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.