#836 - ENH: Add support for @DbArray even for H2 db

This commit is contained in:
Rob Bygrave
2016-11-04 01:16:32 +13:00
parent a1b4af2716
commit f08dd01035
9 changed files with 173 additions and 25 deletions
@@ -14,8 +14,7 @@ public class ScalarTypeArrayListTest {
DataReader mock = Mockito.mock(DataReader.class);
Mockito.when(mock.getArray()).thenReturn(null);
ScalarTypeArrayList scalarType = ScalarTypeArrayList.typeFor(Long.class);
ScalarType<?> scalarType = ScalarTypeArrayList.factory().typeFor(Long.class);
scalarType.read(mock);
}
}
@@ -27,6 +27,9 @@ public class EArrayBean {
@DbArray
List<Long> otherIds = new ArrayList<Long>();
@DbArray
List<Double> doubs;
@Version
Long version;
@@ -70,6 +73,14 @@ public class EArrayBean {
this.otherIds = otherIds;
}
public List<Double> getDoubs() {
return doubs;
}
public void setDoubs(List<Double> doubs) {
this.doubs = doubs;
}
public Long getVersion() {
return version;
}
@@ -28,11 +28,17 @@ public class TestDbArray_basic extends BaseTestCase {
phNumbers.add("4321");
phNumbers.add("9823");
List<Double> doubles = new ArrayList<Double>();
doubles.add(1.3);
doubles.add(2.4);
bean.getUids().add(UUID.randomUUID());
bean.getUids().add(UUID.randomUUID());
bean.getOtherIds().add(95L);
bean.getOtherIds().add(96L);
bean.getOtherIds().add(97L);
bean.setDoubs(doubles);
Ebean.save(bean);