@Override public void delete( IdentifiableObject object, User user ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( object.getClass() ); if ( store != null ) { store.delete( object, user ); } }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> T getByName( Class<T> clazz, String name ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return null; } return (T) store.getByName( name ); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getDataWriteAll( Class<T> clazz ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } return (List<T>) store.getDataWriteAll(); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getDataReadAll( Class<T> clazz ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } return (List<T>) store.getDataReadAll(); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getById( Class<T> clazz, Collection<Integer> ids ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return null; } return (List<T>) store.getById( ids ); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getLikeName( Class<T> clazz, String name ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } return (List<T>) store.getAllLikeName( name ); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getAllSorted( Class<T> clazz ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } return (List<T>) store.getAllOrderedName(); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getByUid( Class<T> clazz, Collection<String> uids ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } return (List<T>) store.getByUid( uids ); }
@Override public <T extends IdentifiableObject> int getCountByLastUpdated( Class<T> clazz, Date lastUpdated ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store != null ) { return store.getCountGeLastUpdated( lastUpdated ); } return 0; }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getBetweenLikeName( Class<T> clazz, Set<String> words, int first, int max ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } return (List<T>) store.getAllLikeName( words, first, max ); }
@Override public <T extends IdentifiableObject> Date getLastUpdated( Class<T> clazz ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return null; } return store.getLastUpdated(); }
@Override public void update( IdentifiableObject object, User user ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( object.getClass() ); if ( store != null ) { store.update( object, user ); } }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> T getByCode( Class<T> clazz, String code ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return null; } return (T) store.getByCode( code ); }
@Override public <T extends IdentifiableObject> int getCount( Class<T> clazz ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store != null ) { return store.getCount(); } return 0; }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getObjects( Class<T> clazz, Collection<Integer> identifiers ) { IdentifiableObjectStore<T> store = (IdentifiableObjectStore<T>) getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } return store.getById( identifiers ); }
@Override public <T extends IdentifiableObject> boolean isAttributeValueUnique( Class<? extends IdentifiableObject> klass, T object, Attribute attribute, String value ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( klass ); return store != null && store.isAttributeValueUnique( object, attribute, value ); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> T getByUniqueAttributeValue( Class<T> clazz, Attribute attribute, String value ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return null; } return (T) store.getByUniqueAttributeValue( attribute, value ); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getAll( Class<T> clazz ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } return (List<T>) store.getAll(); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getByCode( Class<T> clazz, Collection<String> codes ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } return (List<T>) store.getByCode( codes ); }
@Override @SuppressWarnings( "unchecked" ) public <T extends IdentifiableObject> List<T> getAllNoAcl( Class<T> clazz ) { IdentifiableObjectStore<IdentifiableObject> store = getIdentifiableObjectStore( clazz ); if ( store == null ) { return new ArrayList<>(); } return (List<T>) store.getAllNoAcl(); }