@Override public void printFieldIdentityClause(Writer writer) throws ValidationException { try { writer.write(" DEFAULT AUTOINCREMENT"); } catch (IOException ioException) { throw ValidationException.fileError(ioException); } }
/** * ADVANCED: * This function is not supported for naming service other than JNDI or TransportManager.JNDI_NAMING_SERVICE. */ @Override public void setNamingServiceType(int serviceType) { if (serviceType != TransportManager.JNDI_NAMING_SERVICE) { throw ValidationException.operationNotSupported("setNamingServiceType"); } }
public Object getKryo() { Object value = this.kryo.get(); if (value == null) { try { value = this.kryoConstructor.newInstance(); this.kryo.set(value); } catch (Exception exception) { throw ValidationException.reflectiveExceptionWhileCreatingClassInstance("com.esotericsoftware.kryo.Kryo", exception); } } return value; }
public static ValidationException cacheNotSupportedWithEmbeddable(Object embeddableClass) { Object[] args = { embeddableClass }; ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CACHE_NOT_SUPPORTED_WITH_EMBEDDABLE, args)); validationException.setErrorCode(CACHE_NOT_SUPPORTED_WITH_EMBEDDABLE); return validationException; }
setClassExtractor((ClassExtractor) AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(classExtractorClass))); } catch (PrivilegedActionException exception) { throw ValidationException.classNotFoundWhileConvertingClassNames(classExtractorName, exception.getException()); throw ValidationException.reflectiveExceptionWhileCreatingClassInstance(classExtractorName, ex); } catch (InstantiationException e) { throw ValidationException.reflectiveExceptionWhileCreatingClassInstance(classExtractorName, e);
private void constructFieldClassification(ClassLoader classLoader) { try { if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ try { fieldClassification = AccessController.doPrivileged(new PrivilegedClassForName(fieldClassificationName, true, classLoader)); } catch (PrivilegedActionException exception) { throw ValidationException.classNotFoundWhileConvertingClassNames(fieldClassificationName, exception.getException()); } } else { fieldClassification = PrivilegedAccessHelper.getClassForName(fieldClassificationName, true, classLoader); } } catch (ClassNotFoundException exception) { throw ValidationException.classNotFoundWhileConvertingClassNames(fieldClassificationName, exception); } }
project = XMLProjectReader.read(projectString, m_classLoader); } catch (ValidationException validationException) { if (validationException.getErrorCode() == ValidationException.PROJECT_XML_NOT_FOUND) { try { project = XMLProjectReader.read(projectString);
/** * INTERNAL: * Acquires a special historical session for reading objects as of a past time. */ public org.eclipse.persistence.sessions.Session acquireHistoricalSession(org.eclipse.persistence.history.AsOfClause clause) throws ValidationException { throw ValidationException.cannotAcquireHistoricalSession(); }
ServerSession serverSession = (ServerSession)session; if (serverSession.getProject().hasIsolatedCacheClassWithoutUOWIsolation()) { throw ValidationException.isolatedDataNotSupportedInSessionBroker(sessionName); throw ValidationException.cannotAcquireClientSessionFromSession();
throw ValidationException.cannotAcquireDataSource(getName(), exception);
/** * INTERNAL: * In case "proxytype" property is specified connects using proxy connection, * otherwise calls its superclass. */ public Connection connect(Properties properties, Session session) throws DatabaseException, ValidationException { String proxytype = properties.getProperty(OracleOCIConnectionPool.PROXYTYPE); if(proxytype == null || proxytype.length() == 0) { return super.connect(properties, session); } else { try { OracleOCIConnectionPool oracleOCIConnectionPool = (OracleOCIConnectionPool)getDataSource(); if (oracleOCIConnectionPool == null) { try { oracleOCIConnectionPool = (OracleOCIConnectionPool)getContext().lookup(getName()); this.setDataSource(oracleOCIConnectionPool); } catch (NamingException exception) { throw ValidationException.cannotAcquireDataSource(getName(), exception); } } return oracleOCIConnectionPool.getProxyConnection(proxytype, properties); } catch (SQLException exception) { throw DatabaseException.sqlException(exception, true); } catch (ClassCastException classCastException) { throw ValidationException.oracleOCIProxyConnectorRequiresOracleOCIConnectionPool(); } } } }
/** * INTERNAL: * Constructs a HistoricalSession given a valid AsOfClause. */ public org.eclipse.persistence.sessions.Session acquireHistoricalSession(AsOfClause clause) throws ValidationException { if ((clause == null) || (clause.getValue() == null)) { throw ValidationException.cannotAcquireHistoricalSession(); } if (!getProject().hasGenericHistorySupport() && !hasBroker() && ((getPlatform() == null) || !getPlatform().isOracle())) { throw ValidationException.historicalSessionOnlySupportedOnOracle(); } return new HistoricalSession(this, clause); }
throw ValidationException.alreadyLoggedIn(this.getName()); } else { if (this.eventManager != null) {
public static ValidationException cannotAcquireClientSessionFromSession() { Object[] args = { }; ValidationException validationException = new ValidationException(ExceptionMessageGenerator.buildMessage(ValidationException.class, CANNOT_ACQUIRE_CLIENTSESSION_FROM_SESSION, args)); validationException.setErrorCode(CANNOT_ACQUIRE_CLIENTSESSION_FROM_SESSION); return validationException; }
setClassExtractor((ClassExtractor) AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(classExtractorClass))); } catch (PrivilegedActionException exception) { throw ValidationException.classNotFoundWhileConvertingClassNames(classExtractorName, exception.getException()); throw ValidationException.reflectiveExceptionWhileCreatingClassInstance(classExtractorName, ex); } catch (InstantiationException e) { throw ValidationException.reflectiveExceptionWhileCreatingClassInstance(classExtractorName, e);
@SuppressWarnings("unchecked") private Class<T> getAttributeConverterClass(ClassLoader classLoader) { try { if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) { try { return AccessController.doPrivileged(new PrivilegedClassForName(attributeConverterClassName, true, classLoader)); } catch (PrivilegedActionException exception) { throw ValidationException.classNotFoundWhileConvertingClassNames(attributeConverterClassName, exception.getException()); } } else { return PrivilegedAccessHelper.getClassForName(attributeConverterClassName, true, classLoader); } } catch (ClassNotFoundException exception) { throw ValidationException.classNotFoundWhileConvertingClassNames(attributeConverterClassName, exception); } }
project = XMLProjectReader.read(projectString, m_classLoader); } catch (ValidationException validationException) { if (validationException.getErrorCode() == ValidationException.PROJECT_XML_NOT_FOUND) { try { project = XMLProjectReader.read(projectString);
/** * INTERNAL: * Acquires a special historical session for reading objects as of a past time. */ public org.eclipse.persistence.sessions.Session acquireHistoricalSession(org.eclipse.persistence.history.AsOfClause clause) throws ValidationException { throw ValidationException.cannotAcquireHistoricalSession(); }
ServerSession serverSession = (ServerSession)session; if (serverSession.getProject().hasIsolatedCacheClassWithoutUOWIsolation()) { throw ValidationException.isolatedDataNotSupportedInSessionBroker(sessionName); throw ValidationException.cannotAcquireClientSessionFromSession();
throw ValidationException.cannotAcquireDataSource(getName(), exception);