[
http://opensource.atlassian.com/projects/hibernate/browse/HBX-1193?page=c...
]
Steve Maring commented on HBX-1193:
-----------------------------------
I just noticed that there is an OracleMetaDataDialect, but my logs show:
DEBUG [JDBCMetaDataDialect] getIndexInfo(null.LIFESMART.WRKR)
<hibernatetool destdir="target/generated-sources/hbm2java">
<jdbcconfiguration
propertyfile="src/main/build/resources/hibernate.properties"
packagename="com.gentiva.lst.ela.assist.entity.generated"
revengfile="src/main/build/resources/hibernate.reveng.xml"
/>
<hbm2java
jdk5="true"
ejb3="true"
/>
</hibernatetool>
and that hibernate.properties files has:
hibernate.dialect = org.hibernate.dialect.Oracle10gDialect
I know the rest of the settings are working, because those are the connection settings.
So, assuming that OracleMetaDataDialect fixes my problem, why is
org.hibernate.dialect.Oracle10gDialect not triggering its usage?
reverse engineering of UniqueConstraint annotation for function-based
indexes
-----------------------------------------------------------------------------
Key: HBX-1193
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-1193
Project: Hibernate Tools
Issue Type: Bug
Components: hbm2java
Affects Versions: 3.2.4.GA
Reporter: Steve Maring
Labels: engineering, function-based, hbm2java, index, reverse,
uniqueconstraint
getting a runtime error ...
[code]org.hibernate.AnnotationException: Unable to create unique key constraint
(SYS_NC00048$) on table WRKR: SYS_NC00048$ not found[/code]
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 {[/code]
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
[/code]
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 indexes/columns that you
only see in the list of indexes.
tried:
<table name="WRKR">
<column name="SYS_NC00047$" exclude="true"/>
<column name="SYS_NC00048$" exclude="true"/>
</table>
but it didn't help.
The problem seems to be isolated to the annotation generation. I would venture to say
that it should NOT be generating @UniqueConstraint entries for columns that don't
actually exist in the table.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira