com.hack23.cia.service.impl.ViewDataDataContainerFactoryImpl Maven / Gradle / Ivy
/*
* Copyright 2010 James Pether Sörling
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id$
* $HeadURL$
*/
package com.hack23.cia.service.impl;
import java.io.Serializable;
import java.util.List;
import javax.persistence.metamodel.SingularAttribute;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.hack23.cia.service.api.DataContainer;
import com.hack23.cia.service.data.api.DataViewer;
/**
* The Class ViewDataDataContainerFactoryImpl.
*/
@Component
@Transactional(propagation=Propagation.REQUIRED)
@Secured({"ROLE_ANONYMOUS","ROLE_USER", "ROLE_ADMIN" })
public final class ViewDataDataContainerFactoryImpl implements DataViewer,ViewDataDataContainerFactory {
/** The data viewer. */
@Autowired
@Qualifier("DataViewer")
private DataViewer dataViewer;
/**
* Instantiates a new view data data container factory impl.
*/
public ViewDataDataContainerFactoryImpl() {
super();
}
@Override
public DataContainer createDataContainer(final Class clazz) {
return new GenericDataContainer<>(clazz,this);
}
@Override
public T findFirstByProperty(final Class clazz,
final SingularAttribute property, final Object value) {
return dataViewer.findFirstByProperty(clazz, property, value);
}
@Override
public List findListByProperty(final Class clazz,
final SingularAttribute property, final Object value) {
return dataViewer.findListByProperty(clazz, property, value);
}
@Override
public List getAll(final Class clazz) {
return dataViewer.getAll(clazz);
}
@Override
public T load(final Class clazz, final Object id) {
return dataViewer.load(clazz, id);
}
@Override
public List findListByProperty(final Class clazz, final Object[] values,
final SingularAttribute... properties) {
return dataViewer.findListByProperty(clazz, values, properties);
}
@Override
public T findByQueryProperty(final Class clazz,
final SingularAttribute property, final Class clazz2,
final SingularAttribute property2, final Object value) {
return dataViewer.findByQueryProperty(clazz, property, clazz2, property2, value);
}
@Override
public List findListByEmbeddedProperty(final Class clazz,
final SingularAttribute property, final Class clazz2,
final SingularAttribute property2, final Object value) {
return dataViewer.findListByEmbeddedProperty(clazz, property, clazz2, property2, value);
}
@Override
public List getAllOrderBy(final Class clazz, final SingularAttribute property) {
return dataViewer.getAllOrderBy(clazz, property);
}
@Override
public List findOrderedListByProperty(final Class clazz, final SingularAttribute property,
final Object value, final SingularAttribute orderByProperty) {
return dataViewer.findOrderedListByProperty(clazz,property,value,orderByProperty);
}
@Override
public List findOrderedListByProperty(final Class clazz, final SingularAttribute orderByProperty,
final Object[] values, final SingularAttribute... properties) {
return dataViewer.findOrderedListByProperty(clazz,orderByProperty,values,properties);
}
@Override
public List findOrderedListByEmbeddedProperty(final Class clazz, final SingularAttribute property,
final Class clazz2, final SingularAttribute property2, final Object value,
final SingularAttribute orderByProperty) {
return dataViewer.findOrderedListByEmbeddedProperty(clazz,property,clazz2,property2,value,orderByProperty);
}
@Override
public List findOrderedByPropertyListByEmbeddedProperty(final Class clazz, final SingularAttribute property,
final Class clazz2, final SingularAttribute property2, final Object value,
final SingularAttribute orderByProperty) {
return dataViewer.findOrderedByPropertyListByEmbeddedProperty(clazz,property,clazz2,property2,value,orderByProperty);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy