本文整理汇总了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;
}
示例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();
}
示例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);
}
示例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 );
}
示例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" ) );
}
}
示例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);
}
示例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
}
示例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
}
示例9: classToTableName
import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
* Return the unqualified class name
*/
public String classToTableName(String className) {
return StringHelper.unqualify(className);
}
示例10: propertyToColumnName
import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
/**
* Return the unqualified property name
*/
public String propertyToColumnName(String propertyName) {
return StringHelper.unqualify(propertyName);
}
示例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 );
}
示例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;
}
示例13: toString
import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toString() {
return StringHelper.unqualify( getClass().getName() ) +
'(' + entityMetamodel.getName() + ')';
}
示例14: toString
import org.hibernate.util.StringHelper; //导入方法依赖的package包/类
public String toString() {
return StringHelper.unqualify( getClass().getName() ) + '(' + role + ')';
}
示例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;
}
}