Java 类org.hibernate.type.SetType 实例源码

项目:ix3    文件:MetaDataImplHibernate.java   
@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;
    }
}
项目:hibernate-semantic-query    文件:PersisterHelper.java   
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;
    }
}