mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#836 - ENH: Add support for @DbArray even for H2 db
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user