File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
main/java/org/hibernate/metamodel/source/annotations/entity
test/java/org/hibernate/metamodel/source/annotations/entity Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ public void bind() {
119
119
// bind all attributes - simple as well as associations
120
120
bindAttributes ( entityBinding );
121
121
bindTableUniqueConstraints ( entityBinding );
122
+
122
123
// last, but not least we initialize and register the new EntityBinding
123
124
entityBinding .initialize ( entityBindingState );
124
125
meta .addEntity ( entityBinding );
@@ -142,7 +143,7 @@ private void bindTableUniqueConstraints(EntityBinding entityBinding) {
142
143
* @param tableAnnotation JPA annotations which has a {@code uniqueConstraints} attribute.
143
144
* @param table Table which the UniqueKey bind to.
144
145
*/
145
- private void bindUniqueConstraints (AnnotationInstance tableAnnotation ,TableSpecification table ) {
146
+ private void bindUniqueConstraints (AnnotationInstance tableAnnotation , TableSpecification table ) {
146
147
AnnotationValue value = tableAnnotation .value ( "uniqueConstraints" );
147
148
if ( value == null ) {
148
149
return ;
Original file line number Diff line number Diff line change 47
47
*/
48
48
public class UniqueConstraintBindingTests extends BaseAnnotationBindingTestCase {
49
49
@ Test
50
- public void testTableUniqueconstraints () {
50
+ public void testTableUniqueConstraints () {
51
51
buildMetadataSources ( TableWithUniqueConstraint .class );
52
52
EntityBinding binding = getEntityBinding ( TableWithUniqueConstraint .class );
53
53
TableSpecification table = binding .getBaseTable ();
@@ -62,11 +62,10 @@ public void testTableUniqueconstraints() {
62
62
int j = 0 ;
63
63
for ( Column column : key .getColumns () ) {
64
64
j ++;
65
-
66
65
}
67
- assertEquals ( 2 , j );
66
+ assertEquals ( "There should be two columns in the unique constraint" , 2 , j );
68
67
}
69
- assertEquals ( 1 , i );
68
+ assertEquals ( "There should only be one unique constraint" , 1 , i );
70
69
}
71
70
72
71
You can’t perform that action at this time.
0 commit comments