/** * A regular embedded is an element that it is embedded but it is not a key or a collection. * * @param keyColumnNames the column names representing the identifier of the entity * @param column the column we want to check * @return {@code true} if the column represent an attribute of a regular embedded element, {@code false} otherwise */ public static boolean isPartOfRegularEmbedded(String[] keyColumnNames, String column) { return isPartOfEmbedded( column ) && !ArrayHelper.contains( keyColumnNames, column ); }
private static Tuple extractFromObject(Object obj) { if ( obj instanceof Map ) { return extractFromMap( ( (Map) obj ) ); } try { return extractFromPojo( obj ); } catch (Exception e) { throw log.cannotExtractTupleFromObject( obj, e ); } }
@Override public MassIndexer threadsForSubsequentFetching(int numberOfThreads) { log.unsupportedIndexerConfigurationOption( "threadForSubsequentFetching" ); return this; }
private ClosableIterator<Tuple> extractResultSet(String storedProcedureName, Object res) { try { return CollectionHelper.newClosableIterator( TupleExtractor.extractTuplesFromObject( res ) ); } catch (Exception e) { throw log.cannotExtractStoredProcedureResultSet( storedProcedureName, res, e ); } } }
public HostAndPort(String host, Integer port) { Contracts.assertNotNull( host, "host" ); Contracts.assertNotNull( host, "port" ); this.host = host; this.port = port; }
public void configureProperty(String propertyName, ElementType elementType) { if ( elementType != ElementType.FIELD && elementType != ElementType.METHOD ) { throw log.getUnsupportedElementTypeException( elementType ); } if ( !ReflectionHelper.propertyExists( currentEntityType, propertyName, elementType ) ) { throw log.getPropertyDoesNotExistException( currentEntityType.getName(), propertyName, elementType ); } this.currentPropertyName = propertyName; }
/** * Return a transaction context given the session; it never returns {@code null}. * * @param session current {@link Session} * @return the {@link TransactionContext} */ public static TransactionContext transactionContext(Session session) { return transactionContext( (SharedSessionContractImplementor) session ); }
private AssociationContextImpl(AssociationTypeContext associationTypeContext, TuplePointer entityTuplePointer, OperationsQueue operationsQueue, TransactionContext transactionContext) { Contracts.assertParameterNotNull( associationTypeContext, "associationTypeContext" ); this.associationTypeContext = associationTypeContext; this.entityTuplePointer = entityTuplePointer; this.operationsQueue = operationsQueue; this.transactionContext = transactionContext; }
/** * Check if an array contains an element. * * @param array the array with all the elements * @param element the element to find in the array * @return {@code true} if the array contains the element */ public static boolean contains(Object[] array, Object element) { return indexOf( array, element ) != -1; }
/** * Returns true if this grid dialect logger should wrap the real grid dialect * * @return boolean */ public static boolean activationNeeded() { return log.isTraceEnabled(); }
@Override public OperationsQueue getOperationsQueue() { throw LOG.tupleContextNotAvailable(); } }
/** * Asserts that the given object is not {@code null}. * * @param object the object to validate, e.g. a local variable etc. * @param name the name of the object, will be used in the logging message in case the given object is {@code null} * @throws IllegalArgumentException in case the given object is {@code null} */ public static void assertNotNull(Object object, String name) { if ( object == null ) { throw log.mustNotBeNull( name ); } }
@Override public void validate(Integer value) throws HibernateException { if ( value == null ) { return; } if ( value < 1 || value > 65535 ) { throw log.illegalPortValue( value ); } } };
@Override public void lock(Serializable id, Object version, Object object, int timeout, SharedSessionContractImplementor session) throws StaleObjectStateException, LockingStrategyException { throw LOG.unsupportedLockMode( gridDialectClass, lockMode ); } }
private ClosableIterator<Tuple> extractResultSet(String storedProcedureName, Object res) { try { return CollectionHelper.newClosableIterator( TupleExtractor.extractTuplesFromObject( res ) ); } catch (Exception e) { throw log.cannotExtractStoredProcedureResultSet( storedProcedureName, res, e ); } } }
/** * Instantiates a new MultiPoint. * * @param points the list of points */ public GeoMultiPoint(List<GeoPoint> points) { super( TYPE ); Contracts.assertNotNull( points, "points" ); this.points = points; }
@Override public MassIndexer limitIndexedObjectsTo(long maximum) { log.unsupportedIndexerConfigurationOption( "limitIndexedObjectsTo" ); return this; }
@Override public MassIndexer idFetchSize(int idFetchSize) { log.unsupportedIndexerConfigurationOption( "idFetchSize" ); return this; }
@Override public MassIndexer transactionTimeout(int timeoutInSeconds) { log.unsupportedIndexerConfigurationOption( "transactionTimeout" ); return this; }
@Override public MassIndexer threadsToLoadObjects(int numberOfThreads) { log.unsupportedIndexerConfigurationOption( "threadsToLoadObjects" ); return this; }