类org.hibernate.annotations.RowId源码实例Demo

下面列出了怎么用org.hibernate.annotations.RowId的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: lams   文件: EntityBinder.java
public void bindTable(
		String schema,
		String catalog,
		String tableName,
		List<UniqueConstraintHolder> uniqueConstraints,
		String constraints,
		InFlightMetadataCollector.EntityTableXref denormalizedSuperTableXref) {
	EntityTableNamingStrategyHelper namingStrategyHelper = new EntityTableNamingStrategyHelper(
			persistentClass.getClassName(),
			persistentClass.getEntityName(),
			name
	);

	final Identifier logicalName;
	if ( StringHelper.isNotEmpty( tableName ) ) {
		logicalName = namingStrategyHelper.handleExplicitName( tableName, context );
	}
	else {
		logicalName = namingStrategyHelper.determineImplicitName( context );
	}

	final Table table = TableBinder.buildAndFillTable(
			schema,
			catalog,
			logicalName,
			persistentClass.isAbstract(),
			uniqueConstraints,
			null,
			constraints,
			context,
			this.subselect,
			denormalizedSuperTableXref
	);
	final RowId rowId = annotatedClass.getAnnotation( RowId.class );
	if ( rowId != null ) {
		table.setRowId( rowId.value() );
	}

	context.getMetadataCollector().addEntityTableXref(
			persistentClass.getEntityName(),
			logicalName,
			table,
			denormalizedSuperTableXref
	);

	if ( persistentClass instanceof TableOwner ) {
		LOG.debugf( "Bind entity %s on table %s", persistentClass.getEntityName(), table.getName() );
		( (TableOwner) persistentClass ).setTable( table );
	}
	else {
		throw new AssertionFailure( "binding a table for a subclass" );
	}
}
 
 类所在包
 类方法
 同包方法