/src/main/java/com/google/ie/business/service/impl/EntityIndexServiceImpl.java

http://thoughtsite.googlecode.com/ · Java · 68 lines · 36 code · 13 blank · 19 comment · 0 complexity · 3f7ed88029bbe5fa4bb1a6405187baee MD5 · raw file

  1. /* Copyright 2010 Google Inc.
  2. *
  3. * Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS.
  11. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. * See the License for the specific language governing permissions and
  13. * limitations under the License
  14. */
  15. package com.google.ie.business.service.impl;
  16. import com.google.appengine.api.datastore.Key;
  17. import com.google.ie.business.dao.EntityIndexDao;
  18. import com.google.ie.business.domain.EntityIndex;
  19. import com.google.ie.business.service.EntityIndexService;
  20. import org.springframework.beans.factory.annotation.Autowired;
  21. /**
  22. * A service implementation of the {@link EntityIndexService}.
  23. *
  24. * @author Ashish K. Dahiya
  25. */
  26. public class EntityIndexServiceImpl implements EntityIndexService {
  27. @Autowired
  28. private EntityIndexDao entityIndexDao;
  29. @Override
  30. public EntityIndex updateEntityIndex(final EntityIndex entityIndex) {
  31. return entityIndexDao.updateEntityIndex(entityIndex);
  32. }
  33. @Override
  34. public EntityIndex getUnIndexedEntity() {
  35. return entityIndexDao.getUnIndexedEntity();
  36. }
  37. @Override
  38. public <T> T getEntity(final String key, final java.lang.Class<T> clazz) {
  39. return entityIndexDao.findEntityByPrimaryKey(clazz, key);
  40. }
  41. @Override
  42. public EntityIndex getEntity(final Key key) {
  43. return entityIndexDao.findEntityByPrimaryKey(key);
  44. }
  45. @Override
  46. public EntityIndex createEntityIndex(final String primaryKey) {
  47. return entityIndexDao.createEntityIndex(primaryKey);
  48. }
  49. public EntityIndexDao getEntityIndexDao() {
  50. return entityIndexDao;
  51. }
  52. public void setEntityIndexDao(final EntityIndexDao entityIndexDao) {
  53. this.entityIndexDao = entityIndexDao;
  54. }
  55. }