/** * ADVANCED: * Set the receiver's insert query. * This should be an instance of a valid subclass of InsertObjectQuery. * If specified this is used by the descriptor to insert itself into the database. * This gives the user the ability to define exactly how to insert the data into the database, * or access data external from the database or from some other framework. */ public void setInsertQuery(InsertObjectQuery insertQuery) { this.insertQuery = insertQuery; if (insertQuery == null) { return; } this.insertQuery.setIsUserDefined(true); this.insertQuery.setDescriptor(getDescriptor()); }
/** * ADVANCED: * Set the receiver's does exist query. * This should be an instance of a valid subclass of DoesExistQuery. * If specified this is used by the descriptor to query existence of an object in the database. * This gives the user the ability to define exactly how to query existence from the database, * or access data external from the database or from some other framework. */ public void setDoesExistQuery(DoesExistQuery query) { this.doesExistQuery = query; if (query == null) { return; } this.doesExistQuery.setIsUserDefined(true); this.doesExistQuery.setDescriptor(getDescriptor()); }
/** * ADVANCED: * Set the receiver's update query. * This should be an instance of a valid subclass of UpdateObjectQuery. * If specified this is used by the descriptor to update itself in the database. * If the receiver uses optimistic locking this must raise an error on optimistic lock failure. * This gives the user the ability to define exactly how to update the data into the database, * or access data external from the database or from some other framework. */ public void setUpdateQuery(UpdateObjectQuery updateQuery) { this.updateQuery = updateQuery; if (updateQuery == null) { return; } this.updateQuery.setIsUserDefined(true); this.updateQuery.setDescriptor(getDescriptor()); }
/** * ADVANCED: * Set the receiver's does exist query. * This should be an instance of a valid subclass of DoesExistQuery. * If specified this is used by the descriptor to query existence of an object in the database. * This gives the user the ability to define exactly how to query existence from the database, * or access data external from the database or from some other framework. */ public void setDoesExistQuery(DoesExistQuery query) { this.doesExistQuery = query; if (query == null) { return; } this.doesExistQuery.setIsUserDefined(true); this.doesExistQuery.setDescriptor(getDescriptor()); }
/** * ADVANCED: * Set the receiver's update query. * This should be an instance of a valid subclass of UpdateObjectQuery. * If specified this is used by the descriptor to update itself in the database. * If the receiver uses optimistic locking this must raise an error on optimistic lock failure. * This gives the user the ability to define exactly how to update the data into the database, * or access data external from the database or from some other framework. */ public void setUpdateQuery(UpdateObjectQuery updateQuery) { this.updateQuery = updateQuery; if (updateQuery == null) { return; } this.updateQuery.setIsUserDefined(true); this.updateQuery.setDescriptor(getDescriptor()); }
/** * ADVANCED: * Set the receiver's does exist query. * This should be an instance of a valid subclass of DoesExistQuery. * If specified this is used by the descriptor to query existence of an object in the database. * This gives the user the ability to define exactly how to query existence from the database, * or access data external from the database or from some other framework. */ public void setDoesExistQuery(DoesExistQuery query) { this.doesExistQuery = query; if (query == null) { return; } this.doesExistQuery.setIsUserDefined(true); this.doesExistQuery.setDescriptor(getDescriptor()); }
/** * ADVANCED: * Set the receiver's insert query. * This should be an instance of a valid subclass of InsertObjectQuery. * If specified this is used by the descriptor to insert itself into the database. * This gives the user the ability to define exactly how to insert the data into the database, * or access data external from the database or from some other framework. */ public void setInsertQuery(InsertObjectQuery insertQuery) { this.insertQuery = insertQuery; if (insertQuery == null) { return; } this.insertQuery.setIsUserDefined(true); this.insertQuery.setDescriptor(getDescriptor()); }
/** * ADVANCED: * Set the receiver's insert query. * This should be an instance of a valid subclass of InsertObjectQuery. * If specified this is used by the descriptor to insert itself into the database. * This gives the user the ability to define exactly how to insert the data into the database, * or access data external from the database or from some other framework. */ public void setInsertQuery(InsertObjectQuery insertQuery) { this.insertQuery = insertQuery; if (insertQuery == null) { return; } this.insertQuery.setIsUserDefined(true); this.insertQuery.setDescriptor(getDescriptor()); }
/** * ADVANCED: * Set the receiver's update query. * This should be an instance of a valid subclass of UpdateObjectQuery. * If specified this is used by the descriptor to update itself in the database. * If the receiver uses optimistic locking this must raise an error on optimistic lock failure. * This gives the user the ability to define exactly how to update the data into the database, * or access data external from the database or from some other framework. */ public void setUpdateQuery(UpdateObjectQuery updateQuery) { this.updateQuery = updateQuery; if (updateQuery == null) { return; } this.updateQuery.setIsUserDefined(true); this.updateQuery.setDescriptor(getDescriptor()); }
/** * INTERNAL: * This method is explicitly used by the Builder only. */ public void setExistenceCheck(String token) throws DescriptorException { if (token.equals("Check cache")) { checkCacheForDoesExist(); } else if (token.equals("Check database")) { checkDatabaseForDoesExist(); } else if (token.equals("Assume existence")) { assumeExistenceForDoesExist(); } else if (token.equals("Assume non-existence")) { assumeNonExistenceForDoesExist(); } else { throw DescriptorException.setExistenceCheckingNotUnderstood(token, getDescriptor()); } }
/** * INTERNAL: * This method is explicitly used by the Builder only. */ public void setExistenceCheck(String token) throws DescriptorException { if (token.equals("Check cache")) { checkCacheForDoesExist(); } else if (token.equals("Check database")) { checkDatabaseForDoesExist(); } else if (token.equals("Assume existence")) { assumeExistenceForDoesExist(); } else if (token.equals("Assume non-existence")) { assumeNonExistenceForDoesExist(); } else { throw DescriptorException.setExistenceCheckingNotUnderstood(token, getDescriptor()); } }
/** * INTERNAL: * This method is explicitly used by the Builder only. */ public void setExistenceCheck(String token) throws DescriptorException { if (token.equals("Check cache")) { checkCacheForDoesExist(); } else if (token.equals("Check database")) { checkDatabaseForDoesExist(); } else if (token.equals("Assume existence")) { assumeExistenceForDoesExist(); } else if (token.equals("Assume non-existence")) { assumeNonExistenceForDoesExist(); } else { throw DescriptorException.setExistenceCheckingNotUnderstood(token, getDescriptor()); } }
/** * ADVANCED: * Set the receiver's delete query. * This should be an instance of a valid subclass of DeleteObjectQuery. * If specified this is used by the descriptor to delete itself and its private parts from the database. * This gives the user the ability to define exactly how to delete the data from the database, * or access data external from the database or from some other framework. */ public void setDeleteQuery(DeleteObjectQuery query) { this.deleteQuery = query; if (query == null) { return; } query.setIsUserDefined(true); query.setDescriptor(getDescriptor()); if (query.isCallQuery()) { query.setIsFullRowRequired(true); } }
/** * ADVANCED: * Set the receiver's delete query. * This should be an instance of a valid subclass of DeleteObjectQuery. * If specified this is used by the descriptor to delete itself and its private parts from the database. * This gives the user the ability to define exactly how to delete the data from the database, * or access data external from the database or from some other framework. */ public void setDeleteQuery(DeleteObjectQuery query) { this.deleteQuery = query; if (query == null) { return; } query.setIsUserDefined(true); query.setDescriptor(getDescriptor()); if (query.isCallQuery()) { query.setIsFullRowRequired(true); } }
/** * ADVANCED: * Set the receiver's delete query. * This should be an instance of a valid subclass of DeleteObjectQuery. * If specified this is used by the descriptor to delete itself and its private parts from the database. * This gives the user the ability to define exactly how to delete the data from the database, * or access data external from the database or from some other framework. */ public void setDeleteQuery(DeleteObjectQuery query) { this.deleteQuery = query; if (query == null) { return; } query.setIsUserDefined(true); query.setDescriptor(getDescriptor()); if (query.isCallQuery()) { query.setIsFullRowRequired(true); } }
/** * INTERNAL: * Initialize the queryTimeout to: * * NoTimeout: If queryTimeout is DefaultTimeout, either directly or via inheritance. * Parent's Timeout: If queryTimeout is something other than DefaultTimeout via my parent. */ public void initializeQueryTimeout(AbstractSession session) { //if queryTimeout is DefaultTimeout, try to get my parent's queryTimeout if (getQueryTimeout() == DefaultTimeout) { if (getDescriptor().hasInheritance() && (this.getDescriptor().getInheritancePolicy().getParentDescriptor() != null)) { setQueryTimeout(this.getParentDescriptorQueryManager().getQueryTimeout()); } } if (getQueryTimeoutUnit().equals(DefaultTimeoutUnit)) { if (getDescriptor().hasInheritance() && (this.getDescriptor().getInheritancePolicy().getParentDescriptor() != null)) { setQueryTimeoutUnit(this.getParentDescriptorQueryManager().getQueryTimeoutUnit()); } } //if I have DefaultTimeout (via parent or not), set to NoTimeout if (getQueryTimeout() == DefaultTimeout) { setQueryTimeout(NoTimeout); } }
/** * INTERNAL: * Initialize the queryTimeout to: * * NoTimeout: If queryTimeout is DefaultTimeout, either directly or via inheritance. * Parent's Timeout: If queryTimeout is something other than DefaultTimeout via my parent. */ public void initializeQueryTimeout(AbstractSession session) { //if queryTimeout is DefaultTimeout, try to get my parent's queryTimeout if (getQueryTimeout() == DefaultTimeout) { if (getDescriptor().hasInheritance() && (this.getDescriptor().getInheritancePolicy().getParentDescriptor() != null)) { setQueryTimeout(this.getParentDescriptorQueryManager().getQueryTimeout()); } } //if I have DefaultTimeout (via parent or not), set to NoTimeout if (getQueryTimeout() == DefaultTimeout) { setQueryTimeout(NoTimeout); } }
/** * INTERNAL: * Initialize the queryTimeout to: * * NoTimeout: If queryTimeout is DefaultTimeout, either directly or via inheritance. * Parent's Timeout: If queryTimeout is something other than DefaultTimeout via my parent. */ public void initializeQueryTimeout(AbstractSession session) { //if queryTimeout is DefaultTimeout, try to get my parent's queryTimeout if (getQueryTimeout() == DefaultTimeout) { if (getDescriptor().hasInheritance() && (this.getDescriptor().getInheritancePolicy().getParentDescriptor() != null)) { setQueryTimeout(this.getParentDescriptorQueryManager().getQueryTimeout()); } } //if I have DefaultTimeout (via parent or not), set to NoTimeout if (getQueryTimeout() == DefaultTimeout) { setQueryTimeout(NoTimeout); } }
this.initializeQueryTimeout(session); if (getDescriptor().isAggregateDescriptor()) { return; if (getDescriptor().isAggregateCollectionDescriptor()) { return; if (defaultQueryCachePolicy != null && !getDescriptor().getCachePolicy().isIsolated()) { for (List<DatabaseQuery> queries : getQueries().values()) { for (DatabaseQuery query : queries) { getDescriptor().initialize(this, session);
if (getDescriptor().isAggregateDescriptor()) { return; if (getDescriptor().isChildDescriptor()) { DescriptorQueryManager parentQueryManager = getDescriptor().getInheritancePolicy().getParentDescriptor().getQueryManager();