当前位置: 首页>>代码示例>>Java>>正文


Java RootClass.setPolymorphic方法代码示例

本文整理汇总了Java中org.hibernate.mapping.RootClass.setPolymorphic方法的典型用法代码示例。如果您正苦于以下问题:Java RootClass.setPolymorphic方法的具体用法?Java RootClass.setPolymorphic怎么用?Java RootClass.setPolymorphic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.mapping.RootClass的用法示例。


在下文中一共展示了RootClass.setPolymorphic方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bindDiscriminatorProperty

import org.hibernate.mapping.RootClass; //导入方法依赖的package包/类
private static void bindDiscriminatorProperty(Table table, RootClass entity, Element subnode,
		Mappings mappings) {
	SimpleValue discrim = new SimpleValue( mappings, table );
	entity.setDiscriminator( discrim );
	bindSimpleValue(
			subnode,
			discrim,
			false,
			RootClass.DEFAULT_DISCRIMINATOR_COLUMN_NAME,
			mappings
		);
	if ( !discrim.isTypeSpecified() ) {
		discrim.setTypeName( "string" );
		// ( (Column) discrim.getColumnIterator().next() ).setType(type);
	}
	entity.setPolymorphic( true );
	final String explicitForceValue = subnode.attributeValue( "force" );
	boolean forceDiscriminatorInSelects = explicitForceValue == null
			? mappings.forceDiscriminatorInSelectsByDefault()
			: "true".equals( explicitForceValue );
	entity.setForceDiscriminator( forceDiscriminatorInSelects );
	if ( "false".equals( subnode.attributeValue( "insert" ) ) ) {
		entity.setDiscriminatorInsertable( false );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:HbmBinder.java

示例2: bindDiscriminatorColumnToRootPersistentClass

import org.hibernate.mapping.RootClass; //导入方法依赖的package包/类
private static void bindDiscriminatorColumnToRootPersistentClass(
		RootClass rootClass,
		Ejb3DiscriminatorColumn discriminatorColumn,
		Map<String, Join> secondaryTables,
		PropertyHolder propertyHolder,
		Mappings mappings) {
	if ( rootClass.getDiscriminator() == null ) {
		if ( discriminatorColumn == null ) {
			throw new AssertionFailure( "discriminator column should have been built" );
		}
		discriminatorColumn.setJoins( secondaryTables );
		discriminatorColumn.setPropertyHolder( propertyHolder );
		SimpleValue discriminatorColumnBinding = new SimpleValue( mappings, rootClass.getTable() );
		rootClass.setDiscriminator( discriminatorColumnBinding );
		discriminatorColumn.linkWithValue( discriminatorColumnBinding );
		discriminatorColumnBinding.setTypeName( discriminatorColumn.getDiscriminatorTypeName() );
		rootClass.setPolymorphic( true );
		if ( LOG.isTraceEnabled() ) {
			LOG.tracev( "Setting discriminator for entity {0}", rootClass.getEntityName() );
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:AnnotationBinder.java

示例3: bindDiscriminatorProperty

import org.hibernate.mapping.RootClass; //导入方法依赖的package包/类
private static void bindDiscriminatorProperty(Table table, RootClass entity, Element subnode,
		Mappings mappings) {
	SimpleValue discrim = new SimpleValue( table );
	entity.setDiscriminator( discrim );
	bindSimpleValue(
			subnode,
			discrim,
			false,
			RootClass.DEFAULT_DISCRIMINATOR_COLUMN_NAME,
			mappings
		);
	if ( !discrim.isTypeSpecified() ) {
		discrim.setTypeName( "string" );
		// ( (Column) discrim.getColumnIterator().next() ).setType(type);
	}
	entity.setPolymorphic( true );
	if ( "true".equals( subnode.attributeValue( "force" ) ) )
		entity.setForceDiscriminator( true );
	if ( "false".equals( subnode.attributeValue( "insert" ) ) )
		entity.setDiscriminatorInsertable( false );
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:22,代码来源:HbmBinder.java


注:本文中的org.hibernate.mapping.RootClass.setPolymorphic方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。