public Builder setImplicitSchemaName(String implicitSchemaName) { if ( StringHelper.isNotEmpty( implicitSchemaName ) ) { this.implicitSchemaName = implicitSchemaName; } return this; }
/** * For the given SQLException, locates the X/Open-compliant SQLState's class code. * * @param sqlException The exception from which to extract the SQLState class code * @return The SQLState class code, or null. */ public static String extractSqlStateClassCode(SQLException sqlException) { return determineSqlStateClassCode( extractSqlState( sqlException ) ); }
public static String buildSqlDropIndexString( String name, String tableName) { return "drop index " + StringHelper.qualify( tableName, name ); }
/** * Return the column name or the unqualified property name */ public String logicalColumnName(String columnName, String propertyName) { return StringHelper.isNotEmpty( columnName ) ? columnName : StringHelper.unqualify( propertyName ); }
/** * 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); }
@Override @SuppressWarnings({ "unchecked" }) public S deepCopyNotNull(S value) { return (S) SerializationHelper.clone( value ); }
@Override public int hashCode() { return hashcode.getValue(); } @Override
/** * Interpret a long as its binary form * * @param longValue The long to interpret to binary * * @return The binary */ public static byte[] fromLong(long longValue) { byte[] bytes = new byte[8]; fromLong(longValue, bytes, 0); return bytes; }
/** * Interpret the binary representation of a long. * * @param bytes The bytes to interpret. * * @return The long */ public static long asLong(byte[] bytes) { return asLong(bytes, 0); }
/** * Returns a string containing the specified number of indentations, where * each indentation contains {@link #INDENTATION} blank characters. * * * @param nIndentations the number of indentations in the returned String. * @return the String containing the specified number of indentations. */ public String generateNodePrefix(int nIndentations) { return StringHelper.repeat( ' ', nIndentations * INDENTATION ) + " - "; } }
private static String[] multiply(String[] strings, String placeholder, String[] replacements) { String[] results = new String[replacements.length * strings.length]; int n = 0; for ( String replacement : replacements ) { for ( String string : strings ) { results[n++] = replaceOnce( string, placeholder, replacement ); } } return results; }
public static Class reflectedPropertyClass( MetadataBuildingContext buildingContext, Class attributeOwnerClass, final String attributeName) { return ReflectHelper.reflectedPropertyClass( attributeOwnerClass, attributeName ); } }
public static Method getterMethodOrNull(Class containerJavaType, String propertyName) { try { return findGetterMethod( containerJavaType, propertyName ); } catch (PropertyNotFoundException e) { return null; } }
public T getValue() { if ( value == null ) { value = valueInitializer.initialize(); } return value; }
public Builder setImplicitCatalogName(String implicitCatalogName) { if ( StringHelper.isNotEmpty( implicitCatalogName ) ) { this.implicitCatalogName = implicitCatalogName; } return this; }
/** * Return the unqualified property name */ public String propertyToColumnName(String propertyName) { return StringHelper.unqualify(propertyName); } /**
@Override public String logicalCollectionColumnName(String columnName, String propertyName, String referencedColumn) { return StringHelper.isNotEmpty( columnName ) ? columnName : propertyName + "_" + referencedColumn; }
public EntityNamingSourceImpl(String entityName, String className, String jpaEntityName) { this.entityName = entityName; this.className = className; this.jpaEntityName = jpaEntityName; this.typeName = StringHelper.isNotEmpty( className ) ? className : entityName; }
public Builder setImplicitTenantIdColumnName(String implicitTenantIdColumnName) { if ( StringHelper.isNotEmpty( implicitTenantIdColumnName ) ) { this.implicitTenantIdColumnName = implicitTenantIdColumnName; } return this; }
public Builder setImplicitPackageName(String implicitPackageName) { if ( StringHelper.isNotEmpty( implicitPackageName ) ) { this.implicitPackageName = implicitPackageName; } return this; }