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.  [ 1 post ] 
Author Message
 Post subject: MultipleHiLoPerTableGenerator and identifier type
PostPosted: Wed Mar 23, 2005 12:29 pm 
Newbie

Joined: Tue Mar 22, 2005 3:50 pm
Posts: 4
The MultipleHiLoPerTableGenerator always creates a table with the value_column of type int however the tables used by classes can have an id type other than int. This obviously creates a type mismatch.

Hibernate version:

Hibernate 3.0 rc 1

Mapping documents:

Code:
<id name="id" type="long" column="object_id">
    <generator class="org.hibernate.id.MultipleHiLoPerTableGenerator">
        <param name="table">sequences</param>
        <param name="primary_key_column">sequence_name</param>
        <param name="value_column">value</param>
        <param name="primary_key_value">acs_object_id_seq</param>
        <param name="primary_key_length">100</param>
    </generator>
</id>


The generated DDL SQL (SchemaExport(cfg)):

Code:
create table foo (
   object_id numeric(19,0) not null,
)

create table sequences (
    sequence_name varchar(100),
    value int
)


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

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.