private EntityTableObjectNameSource(String explicitName, String entityName) { this.explicitName = explicitName; this.logicalName = StringHelper.isNotEmpty( explicitName ) ? explicitName : StringHelper.unqualify( entityName ); }
@Override public String logicalCollectionColumnName(String columnName, String propertyName, String referencedColumn) { return StringHelper.isNotEmpty( columnName ) ? columnName : propertyName + "_" + referencedColumn; }
public static String buildSafeClassName(String className, String defaultPackageName) { if ( className.indexOf( '.' ) < 0 && StringHelper.isNotEmpty( defaultPackageName ) ) { className = StringHelper.qualify( defaultPackageName, className ); } return className; }
/** * Tries to load Hibernate Search event listener. * * @return An event listener instance in case the jar was available. */ private static Class<?> attemptToLoadSearchEventListener() { Class searchEventListenerClass = null; try { searchEventListenerClass = ReflectHelper.classForName( FULL_TEXT_INDEX_EVENT_LISTENER_CLASS, HibernateSearchEventListenerRegister.class); } catch (ClassNotFoundException e) { log.debug("Search not present in classpath, ignoring event listener registration."); } return searchEventListenerClass; }
public String propertyToColumnName(String propertyName) { return StringHelper.unqualify( propertyName ); }
public WrappedInferredData(PropertyData inferredData, String suffix) { this.wrappedInferredData = inferredData; this.propertyName = StringHelper.qualify( inferredData.getPropertyName(), suffix ); } }
public boolean isNameDeferred() { return mappingColumn == null || StringHelper.isEmpty( mappingColumn.getName() ); }
private static byte[] toBytes(Object object) throws SerializationException { return SerializationHelper.serialize( (Serializable) object ); }
public boolean equals(Object x, Object y) throws HibernateException { if ( x == y ) return true; if ( x == null || y == null ) return false; if ( x instanceof Character[] ) { Object[] o1 = (Object[]) x; Object[] o2 = (Object[]) y; return ArrayHelper.isEquals( o1, o2 ); } else { char[] c1 = (char[]) x; char[] c2 = (char[]) y; return ArrayHelper.isEquals( c1, c2 ); } }
public String determineImplicitName(NamingStrategy strategy) { final String strategyResult = strategy.collectionTableName( ownerEntity, ownerObjectName, associatedEntity, unquotedAssocTable, propertyName ); return ownerEntityTableQuoted || associatedEntityTableQuoted ? StringHelper.quote( strategyResult ) : strategyResult; }
public String logicalCollectionColumnName(String columnName, String propertyName, String referencedColumn) { return StringHelper.isNotEmpty( columnName ) ? columnName : StringHelper.unqualify( propertyName ) + "_" + referencedColumn; } }
@Override public String logicalColumnName(String columnName, String propertyName) { return StringHelper.isNotEmpty( columnName ) ? columnName : propertyName; }
public String classToTableName(String className) { return StringHelper.unqualify( className ); }
@Override public boolean isEqual(Object x, Object y, EntityMode entityMode, SessionFactoryImplementor factory) { if ( x == y ) return true; if ( x == null || y == null ) return false; if ( x instanceof Byte[] ) { Object[] o1 = (Object[]) x; Object[] o2 = (Object[]) y; return ArrayHelper.isEquals( o1, o2 ); } else { byte[] c1 = (byte[]) x; byte[] c2 = (byte[]) y; return ArrayHelper.isEquals( c1, c2 ); } }
public String logicalColumnName(String columnName, String propertyName) { return StringHelper.isNotEmpty( columnName ) ? columnName : StringHelper.unqualify( propertyName ); }
public boolean isFormula() { return StringHelper.isNotEmpty(formulaString) ? true : false; }
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 ); }
public boolean isSecondary() { if ( propertyHolder == null ) { throw new AssertionFailure( "Should not call getTable() on column wo persistent class defined" ); } if ( StringHelper.isNotEmpty( secondaryTableName ) ) { return true; } // else { return false; }