@Override public es.logongas.ix3.dao.metadata.CollectionType getCollectionType() { ClassMetadata classMetadata = getClassMetadata(); if (classMetadata == null) { throw new RuntimeException("No existen los metadatos"); } if (type instanceof SetType) { return es.logongas.ix3.dao.metadata.CollectionType.Set; } else if (type instanceof ListType) { return es.logongas.ix3.dao.metadata.CollectionType.List; } else if (type instanceof MapType) { return es.logongas.ix3.dao.metadata.CollectionType.Map; } else { return null; } }
public static CollectionClassification interpretCollectionClassification(CollectionType collectionType) { if ( collectionType instanceof BagType || collectionType instanceof IdentifierBagType ) { return CollectionClassification.BAG; } else if ( collectionType instanceof ListType || collectionType instanceof ArrayType ) { return CollectionClassification.LIST; } else if ( collectionType instanceof SetType || collectionType instanceof OrderedSetType || collectionType instanceof SortedSetType ) { return CollectionClassification.SET; } else if ( collectionType instanceof MapType || collectionType instanceof OrderedMapType || collectionType instanceof SortedMapType ) { return CollectionClassification.MAP; } else { final Class javaType = collectionType.getReturnedClass(); if ( Set.class.isAssignableFrom( javaType ) ) { return CollectionClassification.SET; } else if ( Map.class.isAssignableFrom( javaType ) ) { return CollectionClassification.MAP; } else if ( List.class.isAssignableFrom( javaType ) ) { return CollectionClassification.LIST; } return CollectionClassification.BAG; } }