本文整理汇总了Java中org.hibernate.mapping.Table.setComment方法的典型用法代码示例。如果您正苦于以下问题:Java Table.setComment方法的具体用法?Java Table.setComment怎么用?Java Table.setComment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hibernate.mapping.Table
的用法示例。
在下文中一共展示了Table.setComment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateIdTableDefinition
import org.hibernate.mapping.Table; //导入方法依赖的package包/类
protected Table generateIdTableDefinition(PersistentClass entityMapping) {
Table idTable = new Table( entityMapping.getTemporaryIdTableName() );
if ( catalog != null ) {
idTable.setCatalog( catalog );
}
if ( schema != null ) {
idTable.setSchema( schema );
}
Iterator itr = entityMapping.getTable().getPrimaryKey().getColumnIterator();
while( itr.hasNext() ) {
Column column = (Column) itr.next();
idTable.addColumn( column.clone() );
}
Column sessionIdColumn = new Column( "hib_sess_id" );
sessionIdColumn.setSqlType( "CHAR(36)" );
sessionIdColumn.setComment( "Used to hold the Hibernate Session identifier" );
idTable.addColumn( sessionIdColumn );
idTable.setComment( "Used to hold id values for the " + entityMapping.getEntityName() + " class" );
return idTable;
}
示例2: processComplementaryTableDefinitions
import org.hibernate.mapping.Table; //导入方法依赖的package包/类
public void processComplementaryTableDefinitions(org.hibernate.annotations.Table table) {
//comment and index are processed here
if ( table == null ) return;
String appliedTable = table.appliesTo();
Iterator tables = persistentClass.getTableClosureIterator();
Table hibTable = null;
while ( tables.hasNext() ) {
Table pcTable = (Table) tables.next();
if ( pcTable.getQuotedName().equals( appliedTable ) ) {
//we are in the correct table to find columns
hibTable = pcTable;
break;
}
hibTable = null;
}
if ( hibTable == null ) {
//maybe a join/secondary table
for ( Join join : secondaryTables.values() ) {
if ( join.getTable().getQuotedName().equals( appliedTable ) ) {
hibTable = join.getTable();
break;
}
}
}
if ( hibTable == null ) {
throw new AnnotationException(
"@org.hibernate.annotations.Table references an unknown table: " + appliedTable
);
}
if ( !BinderHelper.isEmptyAnnotationValue( table.comment() ) ) hibTable.setComment( table.comment() );
TableBinder.addIndexes( hibTable, table.indexes(), mappings );
}
示例3: bindComment
import org.hibernate.mapping.Table; //导入方法依赖的package包/类
private static void bindComment(Table table, Element node) {
Element comment = node.element("comment");
if (comment!=null) table.setComment( comment.getTextTrim() );
}