/** * Convenience method to return a user exception appropriate for this API. * @param msg The message * @param e The cause * @return The JDO exception */ public RuntimeException getUserExceptionForException(String msg, Exception e) { return new JDOUserException(msg, e); }
/** * Set whether this datastore schema is read-only. * @param flag the read-only setting. */ public synchronized void setReadOnlySchema(boolean flag) { throw new JDOUserException("org.jpox.readOnlySchema is deprecated, replaced by org.jpox.readOnlyDatastore"); }
/** * Method to set whether to use subclasses. This is not used with JPOXSQL. * @param subclasses Whether to use subclasses */ public void setSubclasses(boolean subclasses) { throw new JDOUserException(LOCALISER_RDBMS.msg("SQL.CandidateExtentsInapplicableError")); }
/** * Declare the unbound variables to be used in the query. * <p>This implementation always throws a JDOUserException since this * concept doesn't apply to SQL queries. * @param variables the variables separated by semicolons. * @exception JDOUserException Always thrown. * @see javax.jdo.Query#declareVariables */ public void declareVariables(String variables) { throw new JDOUserException(LOCALISER_RDBMS.msg("SQL.VariablesInapplicableError")); }
/** * Set the ordering specification for the result Collection. * <p>This implementation always throws a JDOUserException since this * concept doesn't apply to SQL queries. * @param ordering the ordering specification. * @exception JDOUserException Always thrown. * @see javax.jdo.Query#setOrdering */ public void setOrdering(String ordering) { throw new JDOUserException(LOCALISER_RDBMS.msg("SQL.OrderingNotExplicitError")); }
/** * Mutator to rollback the savepoint. * @param pt The savepoint * @throws SQLException Thrown if an error occurs */ public void rollback(Savepoint pt) throws SQLException { throw new JDOUserException(LOCALISER.msg("Connection.InvalidCall", "rollback")); }
/** * Throw a JDOUserException that the connection is no longer available. */ protected void throwExceptionNotAvailable() { throw new JDOUserException(Localiser.msg("046001")); }
/** * Method to transition to read-field state. * @param op ObjectProvider. * @param isLoaded if the field was previously loaded. * @return new LifeCycle state. **/ public LifeCycleState transitionReadField(ObjectProvider op, boolean isLoaded) { throw new JDOUserException(Localiser.msg("027009"),op.getInternalObjectId()); }
/** * Asserts that the PMF is open. * @throws JDOUserException if it is already closed */ protected void assertIsOpen() { if (isClosed()) { // Comply with Section 11.4 of the JDO spec (throw JDOUserException if already closed) throw new JDOUserException(Localiser.msg("012025")); } }
/** * Method to transition to nontransactional. * @param sm StateManager. * @return new LifeCycle state. **/ public LifeCycleState transitionMakeNontransactional(StateManager sm) { throw new JDOUserException(LOCALISER.msg("LifeCycle.PersistentDirtyToNontransactional"),sm.getInternalObjectId()); }
/** * Method to transition to nontransactional. * @param sm StateManager. * @return new LifeCycle state. **/ public LifeCycleState transitionMakeNontransactional(StateManager sm) { throw new JDOUserException(LOCALISER.msg("LifeCycle.PersistentNewDeletedToNontransactional"),sm.getInternalObjectId()); }
/** * Method to transition to nontransactional. * @param sm StateManager. * @return new LifeCycle state. **/ public LifeCycleState transitionMakeNontransactional(StateManager sm) { throw new JDOUserException(LOCALISER.msg("LifeCycle.PersistentNewToNontransactional"),sm.getInternalObjectId()); }
/** * Method to transition to transient. * @param sm StateManager. * @param useFetchPlan to make transient the fields in the fetch plan * @return new LifeCycle state. **/ public LifeCycleState transitionMakeTransient(StateManager sm, boolean useFetchPlan) { throw new JDOUserException(LOCALISER.msg("LifeCycle.PersistentNewToTransient"),sm.getInternalObjectId()); }
/** * Method to transition to transient. * @param sm StateManager. * @param useFetchPlan to make transient the fields in the fetch plan * @return new LifeCycle state. **/ public LifeCycleState transitionMakeTransient(StateManager sm, boolean useFetchPlan) { throw new JDOUserException(LOCALISER.msg("LifeCycle.PersistentDeletedToTransient"),sm.getInternalObjectId()); }
/** * Method to transition to write-field state. * @param sm StateManager. * @return new LifeCycle state. **/ public LifeCycleState transitionWriteField(StateManager sm) { throw new JDOUserException(LOCALISER.msg("LifeCycle.PersistentDeletedToWriteField"),sm.getInternalObjectId()); }
/** * Method to transition to read-field state. * @param op ObjectProvider. * @param isLoaded if the field was previously loaded. * @return new LifeCycle state. **/ public LifeCycleState transitionReadField(ObjectProvider op, boolean isLoaded) { throw new JDOUserException(Localiser.msg("027005"),op.getInternalObjectId()); }
@Override public <R> R executeResultUnique(Class<R> resultCls) { assertIsOpen(); query.setUnique(true); if (resultCls == null) { throw new JDOUserException("Result Class must be specified"); } this.query.setResultClass(resultCls); return (R) executeInternal(); }
@Override public Object executeResultUnique() { assertIsOpen(); query.setUnique(true); if (query.getResult() == null) { throw new JDOUserException("Cannot call executeResultUnique method when query has result unset. Call executeUnique instead."); } return executeInternal(); }
@Override public T executeUnique() { assertIsOpen(); query.setUnique(true); if (query.getResult() != null) { throw new JDOUserException("Cannot call executeXXX method when query has result set to " + query.getResult() + ". Use executeResultUnique() instead"); } return (T) executeInternal(); }
public void storeStringField(int fieldNumber, String value) { if (checkNonNullable && value == null && statementExpressionIndex[fieldNumber].getMapping().getFieldMetaData().getNullValue() == NullValue.EXCEPTION) { throw new JDOUserException(LOCALISER.msg("ParameterSetter.FieldCannotBeNull",statementExpressionIndex[fieldNumber].getMapping().getFieldMetaData().getFullFieldName())); } statementExpressionIndex[fieldNumber].getMapping().setString(pm, ps, statementExpressionIndex[fieldNumber].getParameterIndex(), value); }