public static < K extends SpecificRecord , S extends SpecificRecord > Dao < Map < String , S > > buildCompositeDaoWithEntityManager ( HTablePool tablePool , String tableName , List < Class < S > > subEntityClasses , SchemaManager schemaManager ) { List < EntityMapper < S >> entityMappers = new ArrayList < EntityMapper < S > > ( ) ; for ( Class < S > subEntityClass : subEntityClasses ) { String entityName = getSchemaFromEntityClass ( subEntityClass ) . getName ( ) ; entityMappers . add ( new VersionedAvroEntityMapper . Builder ( ) . setSchemaManager ( schemaManager ) . setTableName ( tableName ) . setEntityName ( entityName ) . setSpecific ( true ) . < S > build ( ) ) ; } return new SpecificMapCompositeAvroDao < S > ( tablePool , tableName , entityMappers ) ; }
Create a CompositeDao which will return SpecificRecord instances in a Map container .