new owner - child support
This commit is contained in:
parent
2035877d58
commit
2bde87bef2
|
@ -0,0 +1,8 @@
|
|||
package org.baeldung.spring.persistence.service;
|
||||
|
||||
import org.baeldung.spring.persistence.dao.common.IOperations;
|
||||
import org.baeldung.spring.persistence.model.Child;
|
||||
|
||||
public interface IChildService extends IOperations<Child> {
|
||||
//
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package org.baeldung.spring.persistence.service;
|
||||
|
||||
import org.baeldung.spring.persistence.dao.common.IOperations;
|
||||
import org.baeldung.spring.persistence.model.Owner;
|
||||
|
||||
public interface IOwnerService extends IOperations<Owner> {
|
||||
//
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package org.baeldung.spring.persistence.service.impl;
|
||||
|
||||
import org.baeldung.spring.persistence.dao.IChildDao;
|
||||
import org.baeldung.spring.persistence.dao.common.IOperations;
|
||||
import org.baeldung.spring.persistence.model.Child;
|
||||
import org.baeldung.spring.persistence.service.IChildService;
|
||||
import org.baeldung.spring.persistence.service.common.AbstractService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ChildService extends AbstractService<Child> implements IChildService {
|
||||
|
||||
@Autowired
|
||||
private IChildDao dao;
|
||||
|
||||
public ChildService() {
|
||||
super();
|
||||
}
|
||||
|
||||
// API
|
||||
|
||||
@Override
|
||||
protected IOperations<Child> getDao() {
|
||||
return dao;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package org.baeldung.spring.persistence.service.impl;
|
||||
|
||||
import org.baeldung.spring.persistence.dao.IOwnerDao;
|
||||
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.service.common.AbstractService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class OwnerService extends AbstractService<Owner> implements IOwnerService {
|
||||
|
||||
@Autowired
|
||||
private IOwnerDao dao;
|
||||
|
||||
public OwnerService() {
|
||||
super();
|
||||
}
|
||||
|
||||
// API
|
||||
|
||||
@Override
|
||||
protected IOperations<Owner> getDao() {
|
||||
return dao;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package org.baeldung.spring.persistence.service;
|
||||
|
||||
import org.baeldung.spring.persistence.config.PersistenceConfig;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.support.AnnotationConfigContextLoader;
|
||||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(classes = { PersistenceConfig.class }, loader = AnnotationConfigContextLoader.class)
|
||||
public class OwnerServicePersistenceIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private IOwnerService service;
|
||||
|
||||
@Autowired
|
||||
private IChildService childService;
|
||||
|
||||
// tests
|
||||
|
||||
@Test
|
||||
public final void whenContextIsBootstrapped_thenNoExceptions() {
|
||||
//
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue