*/
private List<String> getEmbeddedCollectionColumns() {
List<String> embeddedCollections = new ArrayList<String>();
for ( String property : getPropertyNames() ) {
Type propertyType = getPropertyType( property );
if ( propertyType.isAssociationType() ) {
Joinable associatedJoinable = ( (AssociationType) propertyType ).getAssociatedJoinable( getFactory() );
// *-to-many
if ( associatedJoinable.isCollection() ) {
OgmCollectionPersister inversePersister = (OgmCollectionPersister) associatedJoinable;
if ( gridDialect.isStoredInEntityStructure( inversePersister.getAssociationKeyMetadata(), inversePersister.getAssociationTypeContext( property ) ) ) {
embeddedCollections.add( property );
}
}
// *-to-one
else {
// TODO: For now I'm adding all *-to-one columns to the projection list; Actually we need to ask the
// dialect whether it's an embedded association, which we can't find out atm. though as we need all
// entity persisters to be set up for this
embeddedCollections.add( property );
}
}
// for embeddables check whether they contain element collections
else if ( propertyType.isComponentType() ) {
collectEmbeddedCollectionColumns( (ComponentType) propertyType, property, embeddedCollections );
}
}
return embeddedCollections;