Skip Headers

# Using Java

Previous

Next

To configure existence checking at the descriptor level using Java, use `ClassDescriptor` method `getQueryManager` to acquire the `DescriptorQueryManager` from the descriptor and then use one of the following `DescriptorQueryManager` methods (see Example: Configuring Existence Checking Using Java):

- `checkCacheForDoesExist`–check the session cache. If the object is not in the cache, assume that the object does not exist (do an insert). If the object is in the cache, assume that the object exists (do an update). Oracle recommends using this option for most applications.

- `checkDatabaseForDoesExist`–if an object is not in the cache, query the database to determine if the object exists. If the object exists, do an update. Otherwise, do an insert. Selecting this option may negatively impact performance. For more information, see "Check Database".

- `assumeExistenceForDoesExist`–always assume objects exist: always do an update (never do an insert). For more information, see "Assume Existence".

- `assumeNonExistenceForDoesExist`–always assume objects do not exist: always do an insert (never do an update). For more information, see "Assume Nonexistence".

Configuring Existence Checking Using Java

    descriptor.getQueryManager().checkCacehForDoesExist();