Java 类javax.persistence.SqlResultSetMappings 实例源码

项目:lams    文件:JPAOverriddenAnnotationReader.java   
private SqlResultSetMappings getSqlResultSetMappings(Element tree, XMLContext.Default defaults) {
    List<SqlResultSetMapping> results = buildSqlResultsetMappings( tree, defaults );
    if ( defaults.canUseJavaAnnotations() ) {
        SqlResultSetMapping annotation = getPhysicalAnnotation( SqlResultSetMapping.class );
        addSqlResultsetMappingIfNeeded( annotation, results );
        SqlResultSetMappings annotations = getPhysicalAnnotation( SqlResultSetMappings.class );
        if ( annotations != null ) {
            for ( SqlResultSetMapping current : annotations.value() ) {
                addSqlResultsetMappingIfNeeded( current, results );
            }
        }
    }
    if ( results.size() > 0 ) {
        AnnotationDescriptor ad = new AnnotationDescriptor( SqlResultSetMappings.class );
        ad.setValue( "value", results.toArray( new SqlResultSetMapping[results.size()] ) );
        return AnnotationFactory.create( ad );
    }
    else {
        return null;
    }
}
项目:lams    文件:QueryBinder.java   
public static void bindSqlResultsetMappings(SqlResultSetMappings ann, Mappings mappings, boolean isDefault) {
    if ( ann == null ) return;
    for (SqlResultSetMapping rs : ann.value()) {
        //no need to handle inSecondPass
        mappings.addSecondPass( new ResultsetMappingSecondPass( rs, mappings, true ) );
    }
}
项目:hyperjaxb3    文件:CreateXAnnotations.java   
public XAnnotation<?> createSqlResultSetMapping(
        Collection<SqlResultSetMapping> cSqlResultSetMappings) {
    return transform(
            SqlResultSetMappings.class,
            javax.persistence.SqlResultSetMapping.class,
            cSqlResultSetMappings,
            new Transformer<SqlResultSetMapping, XAnnotation<javax.persistence.SqlResultSetMapping>>() {
                public XAnnotation<javax.persistence.SqlResultSetMapping> transform(
                        SqlResultSetMapping input) {
                    return createSqlResultSetMapping(input);
                }
            });
}