name change

This commit is contained in:
eugenp 2013-05-18 17:15:36 +03:00
parent 2bde87bef2
commit f50f4eb6a6
6 changed files with 20 additions and 20 deletions

View File

@ -1,8 +1,8 @@
package org.baeldung.spring.persistence.dao;
import org.baeldung.spring.persistence.dao.common.IOperations;
import org.baeldung.spring.persistence.model.Owner;
import org.baeldung.spring.persistence.model.Parent;
public interface IOwnerDao extends IOperations<Owner> {
public interface IParentDao extends IOperations<Parent> {
//
}

View File

@ -1,22 +1,22 @@
package org.baeldung.spring.persistence.dao.impl;
import org.baeldung.spring.persistence.dao.IOwnerDao;
import org.baeldung.spring.persistence.dao.IParentDao;
import org.baeldung.spring.persistence.dao.common.AbstractHibernateDao;
import org.baeldung.spring.persistence.model.Owner;
import org.baeldung.spring.persistence.model.Parent;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class OwnerDao extends AbstractHibernateDao<Owner> implements IOwnerDao {
public class ParentDao extends AbstractHibernateDao<Parent> implements IParentDao {
@Autowired
private SessionFactory sessionFactory;
public OwnerDao() {
public ParentDao() {
super();
setClazz(Owner.class);
setClazz(Parent.class);
}
// API

View File

@ -7,13 +7,13 @@ import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class Owner implements Serializable {
public class Parent implements Serializable {
@Id
@GeneratedValue
private long id;
public Owner() {
public Parent() {
super();
}

View File

@ -1,8 +1,8 @@
package org.baeldung.spring.persistence.service;
import org.baeldung.spring.persistence.dao.common.IOperations;
import org.baeldung.spring.persistence.model.Owner;
import org.baeldung.spring.persistence.model.Parent;
public interface IOwnerService extends IOperations<Owner> {
public interface IParentService extends IOperations<Parent> {
//
}

View File

@ -1,27 +1,27 @@
package org.baeldung.spring.persistence.service.impl;
import org.baeldung.spring.persistence.dao.IOwnerDao;
import org.baeldung.spring.persistence.dao.IParentDao;
import org.baeldung.spring.persistence.dao.common.IOperations;
import org.baeldung.spring.persistence.model.Owner;
import org.baeldung.spring.persistence.service.IOwnerService;
import org.baeldung.spring.persistence.model.Parent;
import org.baeldung.spring.persistence.service.IParentService;
import org.baeldung.spring.persistence.service.common.AbstractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class OwnerService extends AbstractService<Owner> implements IOwnerService {
public class ParentService extends AbstractService<Parent> implements IParentService {
@Autowired
private IOwnerDao dao;
private IParentDao dao;
public OwnerService() {
public ParentService() {
super();
}
// API
@Override
protected IOperations<Owner> getDao() {
protected IOperations<Parent> getDao() {
return dao;
}

View File

@ -10,10 +10,10 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class)
public class OwnerServicePersistenceIntegrationTest {
public class ParentServicePersistenceIntegrationTest {
@Autowired
private IOwnerService service;
private IParentService service;
@Autowired
private IChildService childService;