Search in sources :

Example 1 with TableMapping

use of io.jans.orm.sql.model.TableMapping in project jans by JanssenProject.

the class SqlOperationServiceImpl method lookup.

@Override
public List<AttributeData> lookup(String key, String objectClass, String... attributes) throws SearchException, EntryConvertationException {
    Instant startTime = OperationDurationUtil.instance().now();
    TableMapping tableMapping = connectionProvider.getTableMappingByKey(key, objectClass);
    List<AttributeData> result = lookupImpl(tableMapping, key, attributes);
    Duration duration = OperationDurationUtil.instance().duration(startTime);
    OperationDurationUtil.instance().logDebug("SQL operation: lookup, duration: {}, table: {}, key: {}, attributes: {}", duration, tableMapping.getTableName(), key, attributes);
    return result;
}
Also used : Instant(java.time.Instant) TableMapping(io.jans.orm.sql.model.TableMapping) Duration(java.time.Duration) AttributeData(io.jans.orm.model.AttributeData)

Example 2 with TableMapping

use of io.jans.orm.sql.model.TableMapping in project jans by JanssenProject.

the class SqlOperationServiceImpl method deleteRecursively.

@Override
public boolean deleteRecursively(String key, String objectClass) throws EntryNotFoundException, SearchException {
    Instant startTime = OperationDurationUtil.instance().now();
    TableMapping tableMapping = connectionProvider.getTableMappingByKey(key, objectClass);
    boolean result = deleteRecursivelyImpl(tableMapping, key);
    Duration duration = OperationDurationUtil.instance().duration(startTime);
    OperationDurationUtil.instance().logDebug("SQL operation: delete_tree, duration: {}, table: {}, key: {}", duration, tableMapping.getTableName(), key);
    return result;
}
Also used : Instant(java.time.Instant) TableMapping(io.jans.orm.sql.model.TableMapping) Duration(java.time.Duration)

Example 3 with TableMapping

use of io.jans.orm.sql.model.TableMapping in project jans by JanssenProject.

the class SqlOperationServiceImpl method delete.

@Override
public long delete(String key, String objectClass, ConvertedExpression expression, int count) throws DeleteException {
    Instant startTime = OperationDurationUtil.instance().now();
    TableMapping tableMapping = connectionProvider.getTableMappingByKey(key, objectClass);
    long result = deleteImpl(tableMapping, expression, count);
    Duration duration = OperationDurationUtil.instance().duration(startTime);
    OperationDurationUtil.instance().logDebug("SQL operation: delete_search, duration: {}, table: {}, key: {}, expression: {}, count: {}", duration, tableMapping.getTableName(), key, expression, count);
    return result;
}
Also used : Instant(java.time.Instant) TableMapping(io.jans.orm.sql.model.TableMapping) Duration(java.time.Duration)

Example 4 with TableMapping

use of io.jans.orm.sql.model.TableMapping in project jans by JanssenProject.

the class SqlOperationServiceImpl method addEntry.

@Override
public boolean addEntry(String key, String objectClass, Collection<AttributeData> attributes) throws DuplicateEntryException, PersistenceException {
    Instant startTime = OperationDurationUtil.instance().now();
    TableMapping tableMapping = connectionProvider.getTableMappingByKey(key, objectClass);
    boolean result = addEntryImpl(tableMapping, key, attributes);
    Duration duration = OperationDurationUtil.instance().duration(startTime);
    OperationDurationUtil.instance().logDebug("SQL operation: add, duration: {}, table: {}, key: {}, attributes: {}", duration, tableMapping.getTableName(), key, attributes);
    return result;
}
Also used : Instant(java.time.Instant) TableMapping(io.jans.orm.sql.model.TableMapping) Duration(java.time.Duration)

Example 5 with TableMapping

use of io.jans.orm.sql.model.TableMapping in project jans by JanssenProject.

the class SqlOperationServiceImpl method search.

@Override
public <O> PagedResult<EntryData> search(String key, String objectClass, ConvertedExpression expression, SearchScope scope, String[] attributes, OrderSpecifier<?>[] orderBy, SqlBatchOperationWraper<O> batchOperationWraper, SearchReturnDataType returnDataType, int start, int count, int pageSize) throws SearchException {
    Instant startTime = OperationDurationUtil.instance().now();
    TableMapping tableMapping = connectionProvider.getTableMappingByKey(key, objectClass);
    PagedResult<EntryData> result = searchImpl(tableMapping, key, expression, scope, attributes, orderBy, batchOperationWraper, returnDataType, start, count, pageSize);
    Duration duration = OperationDurationUtil.instance().duration(startTime);
    OperationDurationUtil.instance().logDebug("SQL operation: search, duration: {}, table: {}, key: {}, expression: {}, scope: {}, attributes: {}, orderBy: {}, batchOperationWraper: {}, returnDataType: {}, start: {}, count: {}, pageSize: {}", duration, tableMapping.getTableName(), key, expression, scope, attributes, orderBy, batchOperationWraper, returnDataType, start, count, pageSize);
    return result;
}
Also used : EntryData(io.jans.orm.model.EntryData) Instant(java.time.Instant) TableMapping(io.jans.orm.sql.model.TableMapping) Duration(java.time.Duration)

Aggregations

TableMapping (io.jans.orm.sql.model.TableMapping)9 Duration (java.time.Duration)8 Instant (java.time.Instant)8 AttributeData (io.jans.orm.model.AttributeData)2 KeyConversionException (io.jans.orm.exception.KeyConversionException)1 EntryConvertationException (io.jans.orm.exception.operation.EntryConvertationException)1 SearchException (io.jans.orm.exception.operation.SearchException)1 EntryData (io.jans.orm.model.EntryData)1