PageRenderTime 58ms CodeModel.GetById 20ms app.highlight 16ms RepoModel.GetById 11ms app.codeStats 0ms

/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
16package com.google.ie.business.service.impl;
17
18import com.google.appengine.api.datastore.Key;
19import com.google.ie.business.dao.EntityIndexDao;
20import com.google.ie.business.domain.EntityIndex;
21import com.google.ie.business.service.EntityIndexService;
22
23import org.springframework.beans.factory.annotation.Autowired;
24
25/**
26 * A service implementation of the {@link EntityIndexService}.
27 * 
28 * @author Ashish K. Dahiya
29 */
30public class EntityIndexServiceImpl implements EntityIndexService {
31
32    @Autowired
33    private EntityIndexDao entityIndexDao;
34
35    @Override
36    public EntityIndex updateEntityIndex(final EntityIndex entityIndex) {
37        return entityIndexDao.updateEntityIndex(entityIndex);
38    }
39
40    @Override
41    public EntityIndex getUnIndexedEntity() {
42        return entityIndexDao.getUnIndexedEntity();
43    }
44
45    @Override
46    public <T> T getEntity(final String key, final java.lang.Class<T> clazz) {
47        return entityIndexDao.findEntityByPrimaryKey(clazz, key);
48    }
49
50    @Override
51    public EntityIndex getEntity(final Key key) {
52        return entityIndexDao.findEntityByPrimaryKey(key);
53    }
54
55    @Override
56    public EntityIndex createEntityIndex(final String primaryKey) {
57        return entityIndexDao.createEntityIndex(primaryKey);
58    }
59
60    public EntityIndexDao getEntityIndexDao() {
61        return entityIndexDao;
62    }
63
64    public void setEntityIndexDao(final EntityIndexDao entityIndexDao) {
65        this.entityIndexDao = entityIndexDao;
66    }
67}
68