-->
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: hbm2java: uni-constraint gen on "function-based" indexes
PostPosted: Wed Oct 12, 2011 2:45 pm 
Newbie

Joined: Thu Oct 23, 2003 8:19 am
Posts: 14
Location: Tampa, FL USA
I've hit a bump using the hbm2java tool in Hibernate Tools 3.2.4.GA

I'm getting a runtime error ...

Code:
org.hibernate.AnnotationException: Unable to create unique key constraint (SYS_NC00048$) on table WRKR: SYS_NC00048$ not found


the generated entity looks like this:

Code:
@Entity
@Table(name="WRKR"
    , uniqueConstraints = {  @UniqueConstraint(columnNames="SYS_NC00048$"),
                                @UniqueConstraint(columnNames="SYS_NC00047$"),
                                @UniqueConstraint(columnNames="LOGIN_VAL"),
                                @UniqueConstraint(columnNames="SOCL_SECUR_NUM_VAL"),
                                @UniqueConstraint(columnNames="AD_LOGIN_VAL")}
)
public class Wrkr  implements java.io.Serializable {


Interesting thing is that this data seems to be coming from the table Indexes. They read ...

Code:
Index Name              Uniqueness           Index Type               Columns        Column Expression
IX_WRKR_01              UNIQUE      NORMAL                 WRKR_SEQ   
IX_WRKR_12              UNIQUE      NORMAL                 SOCL_SECUR_NUM_VAL   
IX_WRKR_16              UNIQUE      FUNCTION-BASED NORMAL   SYS_NC00047$      UPPER("AD_LOGIN_VAL")
IX_WRKR_17              UNIQUE      FUNCTION-BASED NORMAL   SYS_NC00048$      UPPER("LOGIN_VAL")
IX_WRKR_UQ_LOGIN_VAL     UNIQUE      NORMAL                 LOGIN_VAL   
IX_WRKR_UQ_AD_LOGIN_VAL   UNIQUE      NORMAL                 AD_LOGIN_VAL


WRKR_SEQ is the primary key, and SOCL_SECUR_NUM_VAL, LOGIN_VAL, and AD_LOGIN_VAL are "real" columns. The other two SYS_NC0004#$ are not actual columns in the table. They seem to be some sort of "function-based" Oracle columns.

Is there a way for me to keep those constraints from being generated? Perhaps via some hibernate.reveng.xml configuration?

I tried:
Code:
<table name="WRKR">
      <column name="SYS_NC00047$" exclude="true"/>
      <column name="SYS_NC00048$" exclude="true"/>
</table>


but it didn't help.

Thanks,
Steve Maring
Tampa, FL


Top
 Profile  
 
 Post subject: Re: hbm2java: uni-constraint gen on "function-based" indexes
PostPosted: Fri Oct 14, 2011 10:33 am 
Newbie

Joined: Thu Oct 23, 2003 8:19 am
Posts: 14
Location: Tampa, FL USA
I created a patch for the Oracle SQL that gets the index related metadata ...

https://hibernate.onjira.com/browse/HBX-1193


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.