本文整理汇总了Java中javax.persistence.SqlResultSetMapping类的典型用法代码示例。如果您正苦于以下问题:Java SqlResultSetMapping类的具体用法?Java SqlResultSetMapping怎么用?Java SqlResultSetMapping使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SqlResultSetMapping类属于javax.persistence包,在下文中一共展示了SqlResultSetMapping类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSqlResultsetMappingIfNeeded
import javax.persistence.SqlResultSetMapping; //导入依赖的package包/类
private void addSqlResultsetMappingIfNeeded(SqlResultSetMapping annotation, List<SqlResultSetMapping> resultsets) {
if ( annotation != null ) {
String resultsetName = annotation.name();
boolean present = false;
for ( SqlResultSetMapping current : resultsets ) {
if ( current.name().equals( resultsetName ) ) {
present = true;
break;
}
}
if ( !present ) {
resultsets.add( annotation );
}
}
}
示例2: getSqlResultSetMappings
import javax.persistence.SqlResultSetMapping; //导入依赖的package包/类
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;
}
}
示例3: bindSqlResultsetMappings
import javax.persistence.SqlResultSetMapping; //导入依赖的package包/类
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 ) );
}
}
示例4: ResultsetMappingSecondPass
import javax.persistence.SqlResultSetMapping; //导入依赖的package包/类
public ResultsetMappingSecondPass(SqlResultSetMapping ann, Mappings mappings, boolean isDefault) {
this.ann = ann;
this.mappings = mappings;
this.isDefault = isDefault;
}
示例5: bindSqlResultsetMapping
import javax.persistence.SqlResultSetMapping; //导入依赖的package包/类
public static void bindSqlResultsetMapping(SqlResultSetMapping ann, Mappings mappings, boolean isDefault) {
//no need to handle inSecondPass
mappings.addSecondPass( new ResultsetMappingSecondPass( ann, mappings, isDefault ) );
}