Skip to content

Commit adc544b

Browse files
marko-bekhtasebersole
authored andcommitted
Add "missing" JPA methods in the tests
1 parent ad3e320 commit adc544b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

hibernate-models-testing/src/main/java/org/hibernate/models/testing/orm/ColumnAnnotation.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class ColumnAnnotation implements Column, ColumnDetails {
3232
private String options;
3333
private int length;
3434
private int precision;
35+
private int secondPrecision;
3536
private int scale;
3637

3738
private CheckConstraint[] check;
@@ -180,6 +181,15 @@ public int scale() {
180181
return scale;
181182
}
182183

184+
@Override
185+
public int secondPrecision() {
186+
return secondPrecision;
187+
}
188+
189+
public void secondPrecision(int secondPrecision) {
190+
this.secondPrecision = secondPrecision;
191+
}
192+
183193
public void scale(int scale) {
184194
this.scale = scale;
185195
}

hibernate-models-testing/src/main/java/org/hibernate/models/testing/orm/NamedQueryAnnotation.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,27 @@ public class NamedQueryAnnotation implements NamedQuery, Named {
2424
private String name;
2525
private String query;
2626
private LockModeType lockModeType;
27+
private Class<?> resultClass;
2728
private QueryHint[] hints;
2829

2930
public NamedQueryAnnotation(ModelsContext modelContext) {
3031
lockModeType = LockModeType.NONE;
3132
hints = new QueryHint[0];
33+
resultClass = void.class;
3234
}
3335

3436
public NamedQueryAnnotation(NamedQuery usage, ModelsContext modelContext) {
3537
name = usage.name();
3638
query = usage.query();
3739
hints = extractRepeatedValues( usage, NAMED_QUERY.getAttribute( "hints" ), modelContext );
40+
resultClass = usage.resultClass();
3841
}
3942

4043
public NamedQueryAnnotation(Map<String,Object> attributeValues, ModelsContext modelContext) {
4144
name = (String) attributeValues.get( "name" );
4245
query = attributeValues.get( "query" ).toString();
4346
hints = (QueryHint[]) attributeValues.get( "hints" );
47+
resultClass = (Class<?>) attributeValues.get( "resultClass" );
4448
}
4549

4650
@Override
@@ -58,6 +62,11 @@ public String query() {
5862
return query;
5963
}
6064

65+
@Override
66+
public Class<?> resultClass() {
67+
return resultClass;
68+
}
69+
6170
public void query(String query) {
6271
this.query = query;
6372
}

0 commit comments

Comments
 (0)