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


Java StringHelper.unqualify方法代码示例

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


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

示例1: getClassTableName

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
private static String getClassTableName(
		PersistentClass model, Element node, String schema, String catalog, Table denormalizedSuperTable,
		Mappings mappings
) {
	Attribute tableNameNode = node.attribute( "table" );
	String logicalTableName;
	String physicalTableName;
	if ( tableNameNode == null ) {
		logicalTableName = StringHelper.unqualify( model.getEntityName() );
		physicalTableName = mappings.getNamingStrategy().classToTableName( model.getEntityName() );
	}
	else {
		logicalTableName = tableNameNode.getValue();
		physicalTableName = mappings.getNamingStrategy().tableName( logicalTableName );
	}
	mappings.addTableBinding( schema, catalog, logicalTableName, physicalTableName, denormalizedSuperTable );
	return physicalTableName;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:19,代码来源:HbmBinder.java

示例2: toLoggableString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toLoggableString(Object value, SessionFactoryImplementor factory)
		throws HibernateException {
	if ( value == null ) {
		return "null";
	}
	Map result = new HashMap();
	EntityMode entityMode = tuplizerMapping.guessEntityMode( value );
	if ( entityMode == null ) {
		throw new ClassCastException( value.getClass().getName() );
	}
	Object[] values = getPropertyValues( value, entityMode );
	for ( int i = 0; i < propertyTypes.length; i++ ) {
		result.put( propertyNames[i], propertyTypes[i].toLoggableString( values[i], factory ) );
	}
	return StringHelper.unqualify( getName() ) + result.toString();
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:17,代码来源:ComponentType.java

示例3: foreignKeyColumnName

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
@Override
/**
 * Copied from EJB3NamingStrategy
 */
public String foreignKeyColumnName(String propertyName, String propertyEntityName, String propertyTableName,
	String referencedColumnName)
{
	String header = propertyName != null ? StringHelper.unqualify(propertyName) : propertyTableName;
	if( header == null )
	{
		throw new AssertionFailure("NammingStrategy not properly filled");
	}
	return columnName(header + "_" + referencedColumnName);
}
 
开发者ID:equella,项目名称:Equella,代码行数:15,代码来源:LowercaseImprovedNamingScheme.java

示例4: bindImport

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
private static void bindImport(Element importNode, Mappings mappings) {
	String className = getClassName( importNode.attribute( "class" ), mappings );
	Attribute renameNode = importNode.attribute( "rename" );
	String rename = ( renameNode == null ) ?
					StringHelper.unqualify( className ) :
					renameNode.getValue();
	log.debug( "Import: " + rename + " -> " + className );
	mappings.addImport( className, rename );
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:10,代码来源:HbmBinder.java

示例5: bindDom4jRepresentation

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
private static void bindDom4jRepresentation(Element node, PersistentClass entity,
		Mappings mappings, java.util.Map inheritedMetas) {
	String nodeName = node.attributeValue( "node" );
	if (nodeName==null) nodeName = StringHelper.unqualify( entity.getEntityName() );
	entity.setNodeName(nodeName);

	Element tuplizer = locateTuplizerDefinition( node, EntityMode.DOM4J );
	if ( tuplizer != null ) {
		entity.addTuplizer( EntityMode.DOM4J, tuplizer.attributeValue( "class" ) );
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:12,代码来源:HbmBinder.java

示例6: collectionTableName

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
 * Return the unqualified property name, not the best strategy but a backward compatible one
 */
public String collectionTableName(
		String ownerEntity, String ownerEntityTable, String associatedEntity, String associatedEntityTable,
		String propertyName
) {
	//use a degenerated strategy for backward compatibility
	return StringHelper.unqualify(propertyName);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:11,代码来源:DefaultNamingStrategy.java

示例7: foreignKeyColumnName

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
 * Return the property name or propertyTableName
 */
public String foreignKeyColumnName(
		String propertyName, String propertyEntityName, String propertyTableName, String referencedColumnName
) {
	String header = propertyName != null ? StringHelper.unqualify( propertyName ) : propertyTableName;
	if (header == null) throw new AssertionFailure("NammingStrategy not properly filled");
	return columnName( header ); //+ "_" + referencedColumnName not used for backward compatibility
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:11,代码来源:DefaultNamingStrategy.java

示例8: foreignKeyColumnName

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
 * Return the property name or propertyTableName
 */
public String foreignKeyColumnName(
		String propertyName, String propertyEntityName, String propertyTableName, String referencedColumnName
) {
	String header = propertyName != null ? StringHelper.unqualify( propertyName ) : propertyTableName;
	if (header == null) throw new AssertionFailure("NamingStrategy not properly filled");
	return columnName( header ); //+ "_" + referencedColumnName not used for backward compatibility
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:11,代码来源:ImprovedNamingStrategy.java

示例9: classToTableName

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
 * Return the unqualified class name
 */
public String classToTableName(String className) {
	return StringHelper.unqualify(className);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:7,代码来源:DefaultNamingStrategy.java

示例10: propertyToColumnName

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
 * Return the unqualified property name
 */
public String propertyToColumnName(String propertyName) {
	return StringHelper.unqualify(propertyName);
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:7,代码来源:DefaultNamingStrategy.java

示例11: logicalColumnName

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
 * Return the column name or the unqualified property name
 */
public String logicalColumnName(String columnName, String propertyName) {
	return StringHelper.isNotEmpty( columnName ) ? columnName : StringHelper.unqualify( propertyName );
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:7,代码来源:DefaultNamingStrategy.java

示例12: logicalCollectionColumnName

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
 * Return the column name if explicit or the concatenation of the property name and the referenced column
 */
public String logicalCollectionColumnName(String columnName, String propertyName, String referencedColumn) {
	return StringHelper.isNotEmpty( columnName ) ?
			columnName :
			StringHelper.unqualify( propertyName ) + "_" + referencedColumn;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:9,代码来源:ImprovedNamingStrategy.java

示例13: toString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toString() {
	return StringHelper.unqualify( getClass().getName() ) +
			'(' + entityMetamodel.getName() + ')';
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:5,代码来源:AbstractEntityPersister.java

示例14: toString

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toString() {
	return StringHelper.unqualify( getClass().getName() ) + '(' + role + ')';
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:4,代码来源:AbstractCollectionPersister.java

示例15: getReflectionOptimizer

import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public ReflectionOptimizer getReflectionOptimizer(
		Class clazz,
        String[] getterNames,
        String[] setterNames,
        Class[] types) {
	FastClass fastClass;
	BulkAccessor bulkAccessor;
	try {
		fastClass = FastClass.create( clazz );
		bulkAccessor = BulkAccessor.create( clazz, getterNames, setterNames, types );
		if ( !clazz.isInterface() && !Modifier.isAbstract( clazz.getModifiers() ) ) {
			if ( fastClass == null ) {
				bulkAccessor = null;
			}
			else {
				//test out the optimizer:
				Object instance = fastClass.newInstance();
				bulkAccessor.setPropertyValues( instance, bulkAccessor.getPropertyValues( instance ) );
			}
		}
	}
	catch ( Throwable t ) {
		fastClass = null;
		bulkAccessor = null;
		String message = "reflection optimizer disabled for: " +
		                 clazz.getName() +
		                 " [" +
		                 StringHelper.unqualify( t.getClass().getName() ) +
		                 ": " +
		                 t.getMessage();

		if ( t instanceof BulkAccessorException ) {
			int index = ( ( BulkAccessorException ) t ).getIndex();
			if ( index >= 0 ) {
				message += " (property " + setterNames[index] + ")";
			}
		}

		log.debug( message );
	}

	if ( fastClass != null && bulkAccessor != null ) {
		return new ReflectionOptimizerImpl(
				new InstantiationOptimizerAdapter( fastClass ),
		        new AccessOptimizerAdapter( bulkAccessor, clazz )
		);
	}
	else {
		return null;
	}
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:52,代码来源:BytecodeProviderImpl.java


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