Search in sources :

Example 1 with CorePropertyValidator

use of org.datanucleus.properties.CorePropertyValidator in project datanucleus-api-jdo by datanucleus.

the class JDOPersistenceManagerFactory method setTransactionType.

/**
 * Mutator for the transaction type to use for this persistence factory.
 * @param type Transaction type
 */
public void setTransactionType(String type) {
    assertConfigurable();
    boolean validated = new CorePropertyValidator().validate(PropertyNames.PROPERTY_TRANSACTION_TYPE, type);
    if (validated) {
        getConfiguration().setProperty(PropertyNames.PROPERTY_TRANSACTION_TYPE, type);
    } else {
        throw new JDOUserException(Localiser.msg("012026", "javax.jdo.option.TransactionType", type));
    }
}
Also used : CorePropertyValidator(org.datanucleus.properties.CorePropertyValidator) JDOUserException(javax.jdo.JDOUserException)

Example 2 with CorePropertyValidator

use of org.datanucleus.properties.CorePropertyValidator in project datanucleus-api-jdo by datanucleus.

the class JDOPersistenceManagerFactory method setServerTimeZoneID.

/**
 * Mutator for the timezone id of the datastore server.
 * If not set assumes that it is running in the same timezone as this JVM.
 * @param id Timezone Id to use
 */
public void setServerTimeZoneID(String id) {
    assertConfigurable();
    boolean validated = new CorePropertyValidator().validate(PropertyNames.PROPERTY_SERVER_TIMEZONE_ID, id);
    if (validated) {
        getConfiguration().setProperty(PropertyNames.PROPERTY_SERVER_TIMEZONE_ID, id);
    } else {
        throw new JDOUserException("Invalid TimeZone ID specified");
    }
}
Also used : CorePropertyValidator(org.datanucleus.properties.CorePropertyValidator) JDOUserException(javax.jdo.JDOUserException)

Aggregations

JDOUserException (javax.jdo.JDOUserException)2 CorePropertyValidator (org.datanucleus.properties.CorePropertyValidator)2