@Entitypublic class WithInitialisedCollections extends BaseEntity {
@OneToMany(cascade = CascadeType.PERSIST)
List<Contact> contacts = new ArrayList<>();
@DbArray Set<String> dbArray = new HashSet<>();
public List<Contact> getContacts() { return contacts; }
public void setContacts(List<Contact> contacts) { this.contacts = contacts; }
public Set<String> getDbArray() { return dbArray; }
public void setDbArray(Set<String> dbArray) { this.dbArray = dbArray; }}
@Test public void test() {
WithInitialisedCollections bean = new WithInitialisedCollections(); assertNotNull(bean);
EntityBean eb = (EntityBean)bean; String[] props = eb._ebean_getPropertyNames();
assertEquals("contacts", props[0]); assertEquals("dbArray", props[1]);
Object val5 = eb._ebean_getField(0); Object val9 = eb._ebean_getField(1); assertNull(val5); assertNull(val9);
assertNotNull(bean.getContacts()); assertNotNull(bean.getDbArray());
}
--
---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/549bfa65-27a4-4063-8ebc-4c3e8d4058db%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to eb...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/60eaa3d1-95c2-439a-a4c4-87b9860be735%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Ebean ORM" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ebean/rKQp17GTCJs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ebean+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/CAC%3Dts-F6%3DCLgXdnqrCXBVchn9Z5z084G4mWaMbApohC4WO_q4Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/CAG%2BokVduQ4posOY%2B7Hbt-xOO%2BgkmdyhjuP_d-y2f10bn3sgrqA%40mail.gmail.com.
@Entitypublic class Role extends DomainObject {
@DbArray private Set<String> permissions;
public Set<String> getPermissions() { return Collections.unmodifiableSet(permissions); }
public void addPermissions(String... permissions) { for (String permission : permissions) { this.permissions.add(permission); } }} @Test public void testFindWithPermission() { Role role1 = new Role(); role1.addPermissions("contact:write:2344", "contact:write:2343");
RolesRepository repository = new RolesRepository(); repository.save(role1);
List<Role> rolesFound = repository.findWithPermission("contact:write:2344");
assertThat(rolesFound, containsAnyOrder(hasProperty("id", is(role1.getId())); }To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/60eaa3d1-95c2-439a-a4c4-87b9860be735%40googlegroups.com.
--
---
You received this message because you are subscribed to a topic in the Google Groups "Ebean ORM" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ebean/rKQp17GTCJs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to eb...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/CAC%3Dts-F6%3DCLgXdnqrCXBVchn9Z5z084G4mWaMbApohC4WO_q4Q%40mail.gmail.com.
--
---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eb...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/CAG%2BokVduQ4posOY%2B7Hbt-xOO%2BgkmdyhjuP_d-y2f10bn3sgrqA%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/aefde17b-32c3-4a0a-8983-f506fa21ee1d%40googlegroups.com.
To unsubscribe from this group and all its topics, send an email to ebean+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ebean/CAC%3Dts-EUGtjuwp_oNWbDSEjzj87ksr-O9XRgabsNFhiE0vU5GA%40mail.gmail.com.