name change
This commit is contained in:
parent
2bde87bef2
commit
f50f4eb6a6
|
@ -1,8 +1,8 @@
|
||||||
package org.baeldung.spring.persistence.dao;
|
package org.baeldung.spring.persistence.dao;
|
||||||
|
|
||||||
import org.baeldung.spring.persistence.dao.common.IOperations;
|
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;
|
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.dao.common.AbstractHibernateDao;
|
||||||
import org.baeldung.spring.persistence.model.Owner;
|
import org.baeldung.spring.persistence.model.Parent;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public class OwnerDao extends AbstractHibernateDao<Owner> implements IOwnerDao {
|
public class ParentDao extends AbstractHibernateDao<Parent> implements IParentDao {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SessionFactory sessionFactory;
|
private SessionFactory sessionFactory;
|
||||||
|
|
||||||
public OwnerDao() {
|
public ParentDao() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
setClazz(Owner.class);
|
setClazz(Parent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// API
|
// API
|
|
@ -7,13 +7,13 @@ import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class Owner implements Serializable {
|
public class Parent implements Serializable {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue
|
@GeneratedValue
|
||||||
private long id;
|
private long id;
|
||||||
|
|
||||||
public Owner() {
|
public Parent() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package org.baeldung.spring.persistence.service;
|
package org.baeldung.spring.persistence.service;
|
||||||
|
|
||||||
import org.baeldung.spring.persistence.dao.common.IOperations;
|
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;
|
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.dao.common.IOperations;
|
||||||
import org.baeldung.spring.persistence.model.Owner;
|
import org.baeldung.spring.persistence.model.Parent;
|
||||||
import org.baeldung.spring.persistence.service.IOwnerService;
|
import org.baeldung.spring.persistence.service.IParentService;
|
||||||
import org.baeldung.spring.persistence.service.common.AbstractService;
|
import org.baeldung.spring.persistence.service.common.AbstractService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class OwnerService extends AbstractService<Owner> implements IOwnerService {
|
public class ParentService extends AbstractService<Parent> implements IParentService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOwnerDao dao;
|
private IParentDao dao;
|
||||||
|
|
||||||
public OwnerService() {
|
public ParentService() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
// API
|
// API
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IOperations<Owner> getDao() {
|
protected IOperations<Parent> getDao() {
|
||||||
return dao;
|
return dao;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,10 +10,10 @@ import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class)
|
@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class)
|
||||||
public class OwnerServicePersistenceIntegrationTest {
|
public class ParentServicePersistenceIntegrationTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOwnerService service;
|
private IParentService service;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IChildService childService;
|
private IChildService childService;
|
Loading…
Reference in New Issue