Gerke Kok created Bug OGM-291
Issue Type: Bug Bug
Affects Versions: 4.0-next
Assignee: Unassigned
Components: core
Created: 03/Jul/13 12:54 AM
Description:

The code involved:
Class:org.hibernate.metamodel.source.annotations.attribute.ColumnValues
Method: applyColumnValues(AnnotationInstance)
Line 71 (according to the source attached to version 4.2.2.Final using ivy/maven):
AnnotationValue uniqueValue = columnAnnotation.value( "unique" );
if ( uniqueValue != null )

{ this.unique = nameValue.asBoolean(); }

Where nameValue should be uniqueValue.
This stops me from using the annotation:
@Column(name = "code", unique = true, nullable = false, length = 50)
The workaround is probably adding a unique-index using the @NaturalId, but this is non-standard.

(As this is only a copy/paste mistake I ticked the box 'Suitable for new contributors')

Environment: In a JBoss 7.1 type environment and with org.jboss.jandex.AnnotationValue.asBoolean in my class-path somehow. This might mean that when jandex is not there the alternative might be more forgiving towards the asBoolean which would then hide the mistake in org.hibernate.metamodel.source.annotations.attribute.ColumnValues
Project: Hibernate OGM
Labels: annotations
Priority: Major Major
Reporter: Gerke Kok
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira