com.hack23.cia.service.impl.DataSummaryDataContainer 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.util.ArrayList;
import java.util.List;
import javax.persistence.metamodel.SingularAttribute;
import org.springframework.beans.factory.annotation.Autowired;
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.model.external.riksdagen.person.impl.PersonData;
import com.hack23.cia.service.api.DataContainer;
import com.hack23.cia.service.api.DataSummary;
import com.hack23.cia.service.data.api.CommitteeProposalComponentDataDAO;
import com.hack23.cia.service.data.api.DocumentContentDataDAO;
import com.hack23.cia.service.data.api.DocumentElementDAO;
import com.hack23.cia.service.data.api.DocumentStatusContainerDAO;
import com.hack23.cia.service.data.api.PersonDataDAO;
import com.hack23.cia.service.data.api.VoteDataDAO;
/**
* The Class DataSummaryDataContainer.
*/
@Component("DataSummaryDataContainer")
@Transactional(propagation=Propagation.REQUIRED)
@Secured({"ROLE_ANONYMOUS","ROLE_USER", "ROLE_ADMIN" })
public final class DataSummaryDataContainer implements DataContainer{
/** The committee proposal component data dao. */
@Autowired
private CommitteeProposalComponentDataDAO committeeProposalComponentDataDAO;
/** The document content data dao. */
@Autowired
private DocumentContentDataDAO documentContentDataDAO;
/** The document element dao. */
@Autowired
private DocumentElementDAO documentElementDAO;
/** The document status container dao. */
@Autowired
private DocumentStatusContainerDAO documentStatusContainerDAO;
/** The person data dao. */
@Autowired
private PersonDataDAO personDataDAO;
/** The vote data dao. */
@Autowired
private VoteDataDAO voteDataDAO;
/**
* Instantiates a new data summary data container.
*/
public DataSummaryDataContainer() {
super();
}
@Override
public List getAll() {
final List list = new ArrayList<>();
list.add(load(null));
return list;
}
@Override
public DataSummary load(final String id) {
final List all = personDataDAO.getAll();
final long personSize=all.size();
return new DataSummary(personSize,voteDataDAO.getSize(),voteDataDAO.getSize(),documentElementDAO.getSize(),documentContentDataDAO.getSize(),documentStatusContainerDAO.getSize(),committeeProposalComponentDataDAO.getSize());
}
@Override
public List getAllBy(
final SingularAttribute property,
final Object value) {
return new ArrayList<>();
}
@Override
public List findListByProperty(final Object[] values,
final SingularAttribute... properties) {
return new ArrayList<>();
}
@Override
public T findByQueryProperty(final Class clazz,
final SingularAttribute property, final Class clazz2,
final SingularAttribute property2, final Object value) {
return null;
}
@Override
public List findListByEmbeddedProperty(final Class clazz,
final SingularAttribute property, final Class clazz2,
final SingularAttribute property2, final Object value) {
return new ArrayList<>();
}
@Override
public List getAllOrderBy(final SingularAttribute property) {
return new ArrayList<>();
}
@Override
public List findOrderedListByProperty(final SingularAttribute orderByProperty,
final Object[] values, final SingularAttribute... properties) {
return new ArrayList<>();
}
@Override
public List findOrderedListByEmbeddedProperty(final Class clazz, final SingularAttribute property,
final Class clazz2, final SingularAttribute property2, final Object value,
final SingularAttribute orderByProperty) {
return new ArrayList<>();
}
@Override
public List findOrderedByPropertyListByEmbeddedProperty(final Class clazz, final SingularAttribute property,
final Class clazz2, final SingularAttribute property2, final Object value,
final SingularAttribute orderByProperty) {
return new ArrayList<>();
}
@Override
public List findOrderedListByProperty(final SingularAttribute property,
final Object value, final SingularAttribute orderByProperty) {
return new ArrayList<>();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy