name change
This commit is contained in:
parent
2bde87bef2
commit
f50f4eb6a6
|
@ -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> {
|
||||
//
|
||||
}
|
|
@ -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
|
|
@ -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();
|
||||
}
|
||||
|
|
@ -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> {
|
||||
//
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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;
|
Loading…
Reference in New Issue