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:
@@ -18,18 +18,17 @@ public class BeanCollectionHelpFactory {
|
||||
/**
|
||||
* Create the helper based on the many property.
|
||||
*/
|
||||
public static <T> BeanCollectionHelp<T> create(BeanPropertyAssocMany<T> manyProperty) {
|
||||
public static <T> BeanCollectionHelp<T> create(BeanPropertyAssocMany<T> many) {
|
||||
|
||||
boolean elementCollection = manyProperty.isElementCollection();
|
||||
|
||||
ManyType manyType = manyProperty.getManyType();
|
||||
boolean elementCollection = many.isElementCollection();
|
||||
ManyType manyType = many.getManyType();
|
||||
switch (manyType) {
|
||||
case LIST:
|
||||
return elementCollection ? new BeanListHelpElement<>(manyProperty) : new BeanListHelp<>(manyProperty);
|
||||
return elementCollection ? new BeanListHelpElement<>(many) : new BeanListHelp<>(many);
|
||||
case SET:
|
||||
return new BeanSetHelp<>(manyProperty);
|
||||
return elementCollection ? new BeanSetHelpElement<>(many) : new BeanSetHelp<>(many);
|
||||
case MAP:
|
||||
return new BeanMapHelp<>(manyProperty);
|
||||
return new BeanMapHelp<>(many);
|
||||
default:
|
||||
throw new RuntimeException("Invalid type " + manyType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user