mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#115 - Mapping - Add support for @ElementCollection enhancement
Initial support - add simple Set support and Json support for simple List and Set.
This commit is contained in:
@@ -28,7 +28,7 @@ public class TestElementCollectionBasic extends BaseTestCase {
|
||||
Ebean.find(EcPerson.class).where()
|
||||
.startsWith("name", "Fiona0")
|
||||
.order().asc("id")
|
||||
.findList();
|
||||
.findList();
|
||||
|
||||
List<String> phoneNumbers0 = found.get(0).getPhoneNumbers();
|
||||
List<String> phoneNumbers1 = found.get(1).getPhoneNumbers();
|
||||
@@ -46,6 +46,12 @@ public class TestElementCollectionBasic extends BaseTestCase {
|
||||
.order().asc("id")
|
||||
.findList();
|
||||
|
||||
System.out.println(found2);
|
||||
assertThat(found2).hasSize(2);
|
||||
EcPerson foundFirst = found2.get(0);
|
||||
String asJson = Ebean.json().toJson(foundFirst);
|
||||
|
||||
EcPerson fromJson = Ebean.json().toBean(EcPerson.class, asJson);
|
||||
|
||||
assertThat(fromJson.getPhoneNumbers()).containsAll(foundFirst.getPhoneNumbers());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user