本文整理汇总了Java中javax.persistence.ColumnResult类的典型用法代码示例。如果您正苦于以下问题:Java ColumnResult类的具体用法?Java ColumnResult怎么用?Java ColumnResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColumnResult类属于javax.persistence包,在下文中一共展示了ColumnResult类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildConstructorResult
import javax.persistence.ColumnResult; //导入依赖的package包/类
private static ConstructorResult buildConstructorResult(Element constructorResultElement, XMLContext.Default defaults) {
AnnotationDescriptor constructorResultDescriptor = new AnnotationDescriptor( ConstructorResult.class );
final Class entityClass = resolveClassReference( constructorResultElement.attributeValue( "target-class" ), defaults );
constructorResultDescriptor.setValue( "targetClass", entityClass );
List<ColumnResult> columnResultAnnotations = new ArrayList<ColumnResult>();
for ( Element columnResultElement : (List<Element>) constructorResultElement.elements( "column" ) ) {
columnResultAnnotations.add( buildColumnResult( columnResultElement, defaults ) );
}
constructorResultDescriptor.setValue(
"columns",
columnResultAnnotations.toArray( new ColumnResult[ columnResultAnnotations.size() ] )
);
return AnnotationFactory.create( constructorResultDescriptor );
}
示例2: buildColumnResult
import javax.persistence.ColumnResult; //导入依赖的package包/类
private static ColumnResult buildColumnResult(Element columnResultElement, XMLContext.Default defaults) {
// AnnotationDescriptor columnResultDescriptor = new AnnotationDescriptor( ColumnResult.class );
// copyStringAttribute( columnResultDescriptor, columnResultElement, "name", true );
// return AnnotationFactory.create( columnResultDescriptor );
AnnotationDescriptor columnResultDescriptor = new AnnotationDescriptor( ColumnResult.class );
copyStringAttribute( columnResultDescriptor, columnResultElement, "name", true );
final String columnTypeName = columnResultElement.attributeValue( "class" );
if ( StringHelper.isNotEmpty( columnTypeName ) ) {
columnResultDescriptor.setValue( "type", resolveClassReference( columnTypeName, defaults ) );
}
return AnnotationFactory.create( columnResultDescriptor );
}