-->
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.  [ 2 posts ] 
Author Message
 Post subject: <id ...> entry in .hbm.xml for a primary key spanning
PostPosted: Wed Oct 06, 2004 12:13 am 
Newbie

Joined: Tue Oct 05, 2004 11:52 pm
Posts: 2
I am trying to generate an identifier generator class that provides the primary key for this table, and provide an <id ...> entry in .hbm.xml
for this table. Could someone please help?

create table iv_prs
( protocol_id varchar2(255),
CONSTRAINT iv_prs_pk PRIMARY KEY (protocol_id, version, protocol_id_num),
protocol_id_num varchar2(100),
protocol_name varchar2(255) CONSTRAINT iprs_protocolname_nn NOT NULL,
base_protocol varchar2(255),
description clob,
version varchar2(20),
xmlRep blob,
digest varchar2(100),
isActive varchar2(10),
release_version varchar2(10),
compilation_priority number(10),
TS date DEFAULT sysdate);

As the primary key spans 3 cols, I am wondering how to go about.
I appreciate any help that I can get.

Thanks,
Naga


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 06, 2004 12:19 am 
Newbie

Joined: Tue Oct 05, 2004 11:52 pm
Posts: 2
I am using Hibernate 2.1.6. The dialect is Oracle9Dialect.
The database version is Oracle9i (9.2.0.5.0).

I tried with this method in the persistent class ...

/**
* Id Generation
*/
public synchronized Serializable generate(
SessionImplementor session,
Object object)
throws SQLException, HibernateException
{
return protocolId;
}

after making the class implement IdentifierGenerator, but I get ...

net.sf.hibernate.id.IdentifierGenerationException: null id generated for: class com.intruvert.ruleEngine.profile.filter.definitions.IVPrs


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.