eclipselink - JPA metamodel and @Convert on a List<String> attribute -
i'm exploring possibilities of using jpa metamodel criteria api.
i have entities have attributes this:
@column( name = "defaultvalue" ) @convert( converter = stringlisttostringconverter.class ) private list<string> defaultvalue;
the db column varchar holds comma-separated list of strings (it's legacy table). converter nicely allows use real collection type when working entity attribute. i'm confused metamodel eclipselink creates. attribute represented this:
public static volatile singularattribute<myentity, list> defaultvalue;
the raw type warning declaration triggers little ugly. enforced specification? there prevent declaration instead:
public static volatile singularattribute<myentity, list<string>> defaultvalue;
i wonder if declaration can lead problems when construct criteria queries based on metamodel. example, possible construct filter checks if specific value contained in list, like
[...] where( literal( "element" ).in( entity.get( defaultvalue ) ) )
(maybe makes no sense @ - i've started criteria api basics)
am right assume
listattribute
not selected type metamodel here becausecollectionattribute
s in general used expressing relationships other entities/element collections?
Comments
Post a Comment