Search in sources :

Example 11 with JavaTypeMapping

use of org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping in project datanucleus-rdbms by datanucleus.

the class AppIDObjectIdFieldManager method storeLongField.

/**
 * Method to store a long in a field.
 * @param fieldNumber Number of the field
 * @param value The value to use
 */
public void storeLongField(int fieldNumber, long value) {
    JavaTypeMapping mapping = javaTypeMappings[mappingNum++];
    mapping.setLong(ec, statement, getParamsForField(mapping), value);
}
Also used : JavaTypeMapping(org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping)

Example 12 with JavaTypeMapping

use of org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping in project datanucleus-rdbms by datanucleus.

the class AppIDObjectIdFieldManager method storeStringField.

/**
 * Method to store a String in a field.
 * @param fieldNumber Number of the field
 * @param value The value to use
 */
public void storeStringField(int fieldNumber, String value) {
    JavaTypeMapping mapping = javaTypeMappings[mappingNum++];
    mapping.setString(ec, statement, getParamsForField(mapping), value);
}
Also used : JavaTypeMapping(org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping)

Example 13 with JavaTypeMapping

use of org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping in project datanucleus-rdbms by datanucleus.

the class AppIDObjectIdFieldManager method storeBooleanField.

/**
 * Method to store a boolean in a field.
 * @param fieldNumber Number of the field
 * @param value The value to use
 */
public void storeBooleanField(int fieldNumber, boolean value) {
    JavaTypeMapping mapping = javaTypeMappings[mappingNum++];
    mapping.setBoolean(ec, statement, getParamsForField(mapping), value);
}
Also used : JavaTypeMapping(org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping)

Example 14 with JavaTypeMapping

use of org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping in project datanucleus-rdbms by datanucleus.

the class AppIDObjectIdFieldManager method storeByteField.

/**
 * Method to store a byte in a field.
 * @param fieldNumber Number of the field
 * @param value The value to use
 */
public void storeByteField(int fieldNumber, byte value) {
    JavaTypeMapping mapping = javaTypeMappings[mappingNum++];
    mapping.setByte(ec, statement, getParamsForField(mapping), value);
}
Also used : JavaTypeMapping(org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping)

Example 15 with JavaTypeMapping

use of org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping in project datanucleus-rdbms by datanucleus.

the class AppIDObjectIdFieldManager method storeObjectField.

/**
 * Method to store an object in a field.
 * @param fieldNumber Number of the field
 * @param value The value to use
 */
public void storeObjectField(int fieldNumber, Object value) {
    ApiAdapter api = ec.getApiAdapter();
    if (api.isPersistable(value)) {
        api.copyKeyFieldsFromIdToObject(value, new AppIdObjectIdFieldConsumer(api, this), api.getIdForObject(value));
    } else {
        JavaTypeMapping mapping = javaTypeMappings[mappingNum++];
        mapping.setObject(ec, statement, getParamsForField(mapping), value);
    }
}
Also used : ApiAdapter(org.datanucleus.api.ApiAdapter) JavaTypeMapping(org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping) AppIdObjectIdFieldConsumer(org.datanucleus.state.AppIdObjectIdFieldConsumer)

Aggregations

JavaTypeMapping (org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping)230 SQLExpression (org.datanucleus.store.rdbms.sql.expression.SQLExpression)96 AbstractMemberMetaData (org.datanucleus.metadata.AbstractMemberMetaData)82 RDBMSStoreManager (org.datanucleus.store.rdbms.RDBMSStoreManager)82 SQLExpressionFactory (org.datanucleus.store.rdbms.sql.expression.SQLExpressionFactory)81 DatastoreClass (org.datanucleus.store.rdbms.table.DatastoreClass)76 AbstractClassMetaData (org.datanucleus.metadata.AbstractClassMetaData)69 ArrayList (java.util.ArrayList)66 NucleusException (org.datanucleus.exceptions.NucleusException)57 ClassLoaderResolver (org.datanucleus.ClassLoaderResolver)50 NucleusUserException (org.datanucleus.exceptions.NucleusUserException)47 NumericExpression (org.datanucleus.store.rdbms.sql.expression.NumericExpression)43 SQLTable (org.datanucleus.store.rdbms.sql.SQLTable)37 PersistableMapping (org.datanucleus.store.rdbms.mapping.java.PersistableMapping)30 SelectStatement (org.datanucleus.store.rdbms.sql.SelectStatement)30 StringExpression (org.datanucleus.store.rdbms.sql.expression.StringExpression)27 List (java.util.List)25 ReferenceMapping (org.datanucleus.store.rdbms.mapping.java.ReferenceMapping)22 StatementMappingIndex (org.datanucleus.store.rdbms.query.StatementMappingIndex)21 StringLiteral (org.datanucleus.store.rdbms.sql.expression.StringLiteral)21