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; 
  1. the raw type warning declaration triggers little ugly. enforced specification? there prevent declaration instead:

    public static volatile singularattribute<myentity, list<string>> defaultvalue; 
  2. 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)

  3. am right assume listattribute not selected type metamodel here because collectionattributes in general used expressing relationships other entities/element collections?


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -