Search in sources :

Example 6 with EntityStatistics

use of com.haulmont.cuba.core.entity.EntityStatistics in project cuba by cuba-platform.

the class PersistenceManager method enterStatistics.

@Authenticated
@Override
public synchronized String enterStatistics(String name, Long instanceCount, Integer fetchUI, Integer maxFetchUI, Integer lazyCollectionThreshold, Integer lookupScreenThreshold) {
    if (StringUtils.isBlank(name))
        return "Entity name is required";
    try {
        EntityStatistics es = persistenceManager.enterStatistics(name, instanceCount, fetchUI, maxFetchUI, lazyCollectionThreshold, lookupScreenThreshold);
        StringBuilder sb = new StringBuilder("Statistics for ").append(name).append(" changed:\n");
        sb.append("instanceCount=").append(es.getInstanceCount()).append("\n");
        sb.append("fetchUI=").append(es.getFetchUI()).append("\n");
        sb.append("maxFetchUI=").append(es.getMaxFetchUI()).append("\n");
        sb.append("lazyCollectionThreshold=").append(es.getLazyCollectionThreshold()).append("\n");
        sb.append("lookupScreenThreshold=").append(es.getLookupScreenThreshold()).append("\n");
        return sb.toString();
    } catch (Exception e) {
        log.error("enterStatistics error", e);
        return ExceptionUtils.getStackTrace(e);
    }
}
Also used : EntityStatistics(com.haulmont.cuba.core.entity.EntityStatistics) DbInitializationException(com.haulmont.cuba.core.sys.DbInitializationException) Authenticated(com.haulmont.cuba.security.app.Authenticated)

Aggregations

EntityStatistics (com.haulmont.cuba.core.entity.EntityStatistics)6 DbInitializationException (com.haulmont.cuba.core.sys.DbInitializationException)2 MetaClass (com.haulmont.chile.core.model.MetaClass)1 MetaProperty (com.haulmont.chile.core.model.MetaProperty)1 com.haulmont.cuba.core (com.haulmont.cuba.core)1 Configuration (com.haulmont.cuba.core.global.Configuration)1 Metadata (com.haulmont.cuba.core.global.Metadata)1 Stores (com.haulmont.cuba.core.global.Stores)1 DbmsSpecificFactory (com.haulmont.cuba.core.sys.persistence.DbmsSpecificFactory)1 DbmsType (com.haulmont.cuba.core.sys.persistence.DbmsType)1 Authenticated (com.haulmont.cuba.security.app.Authenticated)1 Connection (java.sql.Connection)1 DatabaseMetaData (java.sql.DatabaseMetaData)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 java.util (java.util)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Inject (javax.inject.Inject)1 Inheritance (javax.persistence.Inheritance)1 InheritanceType (javax.persistence.InheritanceType)1