Rename package to conform to standards
This commit is contained in:
parent
825940ba7c
commit
226e23b603
|
@ -1,6 +1,6 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.baeldung</groupId>
|
<groupId>com.baeldung</groupId>
|
||||||
<artifactId>spring-hibernate4</artifactId>
|
<artifactId>spring-hibernate4</artifactId>
|
||||||
<version>0.1-SNAPSHOT</version>
|
<version>0.1-SNAPSHOT</version>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.dao;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.dao.common.IAuditOperations;
|
||||||
|
import com.baeldung.persistence.model.Bar;
|
||||||
|
|
||||||
|
public interface IBarAuditableDao extends IBarDao, IAuditOperations<Bar> {
|
||||||
|
//
|
||||||
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
package org.baeldung.persistence.dao;
|
package com.baeldung.persistence.dao;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.springframework.data.repository.CrudRepository;
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
|
||||||
public interface IBarCrudRepository extends CrudRepository<Bar, Serializable> {
|
public interface IBarCrudRepository extends CrudRepository<Bar, Serializable> {
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.dao;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
|
import com.baeldung.persistence.model.Bar;
|
||||||
|
|
||||||
|
public interface IBarDao extends IOperations<Bar> {
|
||||||
|
//
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.dao;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.model.Child;
|
||||||
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
|
|
||||||
|
public interface IChildDao extends IOperations<Child> {
|
||||||
|
//
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.dao;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.dao.common.IAuditOperations;
|
||||||
|
import com.baeldung.persistence.model.Foo;
|
||||||
|
|
||||||
|
public interface IFooAuditableDao extends IFooDao, IAuditOperations<Foo> {
|
||||||
|
//
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.dao;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.model.Foo;
|
||||||
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
|
|
||||||
|
public interface IFooDao extends IOperations<Foo> {
|
||||||
|
//
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.dao;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.model.Parent;
|
||||||
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
|
|
||||||
|
public interface IParentDao extends IOperations<Parent> {
|
||||||
|
//
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.dao.common;
|
package com.baeldung.persistence.dao.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.dao.common;
|
package com.baeldung.persistence.dao.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.dao.common;
|
package com.baeldung.persistence.dao.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.dao.common;
|
package com.baeldung.persistence.dao.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.dao.common;
|
package com.baeldung.persistence.dao.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.dao.common;
|
package com.baeldung.persistence.dao.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.dao.common;
|
package com.baeldung.persistence.dao.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.dao.common;
|
package com.baeldung.persistence.dao.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,10 +1,10 @@
|
||||||
package org.baeldung.persistence.dao.impl;
|
package com.baeldung.persistence.dao.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IBarAuditableDao;
|
import com.baeldung.persistence.dao.IBarAuditableDao;
|
||||||
import org.baeldung.persistence.dao.common.AbstractHibernateAuditableDao;
|
import com.baeldung.persistence.dao.common.AbstractHibernateAuditableDao;
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.model.Bar;
|
||||||
|
|
||||||
public class BarAuditableDao extends AbstractHibernateAuditableDao<Bar> implements IBarAuditableDao {
|
public class BarAuditableDao extends AbstractHibernateAuditableDao<Bar> implements IBarAuditableDao {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package org.baeldung.persistence.dao.impl;
|
package com.baeldung.persistence.dao.impl;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IBarDao;
|
import com.baeldung.persistence.dao.common.AbstractHibernateDao;
|
||||||
import org.baeldung.persistence.dao.common.AbstractHibernateDao;
|
import com.baeldung.persistence.dao.IBarDao;
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
|
@ -1,8 +1,8 @@
|
||||||
package org.baeldung.persistence.dao.impl;
|
package com.baeldung.persistence.dao.impl;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IBarDao;
|
import com.baeldung.persistence.dao.IBarDao;
|
||||||
import org.baeldung.persistence.dao.common.AbstractJpaDao;
|
import com.baeldung.persistence.dao.common.AbstractJpaDao;
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.baeldung.persistence.dao.impl;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.dao.common.AbstractHibernateDao;
|
||||||
|
import com.baeldung.persistence.model.Child;
|
||||||
|
import com.baeldung.persistence.dao.IChildDao;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class ChildDao extends AbstractHibernateDao<Child> implements IChildDao {
|
||||||
|
|
||||||
|
public ChildDao() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
setClazz(Child.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// API
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.baeldung.persistence.dao.impl;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.dao.common.AbstractHibernateAuditableDao;
|
||||||
|
import com.baeldung.persistence.model.Foo;
|
||||||
|
import com.baeldung.persistence.dao.IFooAuditableDao;
|
||||||
|
|
||||||
|
public class FooAuditableDao extends AbstractHibernateAuditableDao<Foo> implements IFooAuditableDao {
|
||||||
|
|
||||||
|
public FooAuditableDao() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
setClazz(Foo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// API
|
||||||
|
|
||||||
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
package org.baeldung.persistence.dao.impl;
|
package com.baeldung.persistence.dao.impl;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IFooDao;
|
import com.baeldung.persistence.dao.common.AbstractHibernateDao;
|
||||||
import org.baeldung.persistence.dao.common.AbstractHibernateDao;
|
import com.baeldung.persistence.dao.IFooDao;
|
||||||
import org.baeldung.persistence.model.Foo;
|
import com.baeldung.persistence.model.Foo;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.baeldung.persistence.dao.impl;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.dao.IParentDao;
|
||||||
|
import com.baeldung.persistence.dao.common.AbstractHibernateDao;
|
||||||
|
import com.baeldung.persistence.model.Parent;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class ParentDao extends AbstractHibernateDao<Parent> implements IParentDao {
|
||||||
|
|
||||||
|
public ParentDao() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
setClazz(Parent.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// API
|
||||||
|
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.model;
|
package com.baeldung.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.model;
|
package com.baeldung.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.model;
|
package com.baeldung.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.model;
|
package com.baeldung.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.service;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.dao.common.IAuditOperations;
|
||||||
|
import com.baeldung.persistence.model.Bar;
|
||||||
|
|
||||||
|
public interface IBarAuditableService extends IBarService, IAuditOperations<Bar> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.service;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
|
import com.baeldung.persistence.model.Bar;
|
||||||
|
|
||||||
|
public interface IBarService extends IOperations<Bar> {
|
||||||
|
//
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.service;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.model.Child;
|
||||||
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
|
|
||||||
|
public interface IChildService extends IOperations<Child> {
|
||||||
|
//
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.service;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.dao.common.IAuditOperations;
|
||||||
|
import com.baeldung.persistence.model.Foo;
|
||||||
|
|
||||||
|
public interface IFooAuditableService extends IFooService, IAuditOperations<Foo> {
|
||||||
|
//
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.service;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.model.Foo;
|
||||||
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
|
|
||||||
|
public interface IFooService extends IOperations<Foo> {
|
||||||
|
//
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.baeldung.persistence.service;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.model.Parent;
|
||||||
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
|
|
||||||
|
public interface IParentService extends IOperations<Parent> {
|
||||||
|
//
|
||||||
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
package org.baeldung.persistence.service.common;
|
package com.baeldung.persistence.service.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IAuditOperations;
|
import com.baeldung.persistence.dao.common.IAuditOperations;
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Transactional(value = "hibernateTransactionManager")
|
@Transactional(value = "hibernateTransactionManager")
|
|
@ -1,9 +1,9 @@
|
||||||
package org.baeldung.persistence.service.common;
|
package com.baeldung.persistence.service.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Transactional(value = "hibernateTransactionManager")
|
@Transactional(value = "hibernateTransactionManager")
|
|
@ -1,9 +1,9 @@
|
||||||
package org.baeldung.persistence.service.common;
|
package com.baeldung.persistence.service.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Transactional(value = "jpaTransactionManager")
|
@Transactional(value = "jpaTransactionManager")
|
|
@ -1,9 +1,9 @@
|
||||||
package org.baeldung.persistence.service.common;
|
package com.baeldung.persistence.service.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
|
|
||||||
public abstract class AbstractService<T extends Serializable> implements IOperations<T> {
|
public abstract class AbstractService<T extends Serializable> implements IOperations<T> {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package org.baeldung.persistence.service.common;
|
package com.baeldung.persistence.service.common;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
import org.springframework.data.repository.CrudRepository;
|
import org.springframework.data.repository.CrudRepository;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package org.baeldung.persistence.service.impl;
|
package com.baeldung.persistence.service.impl;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IBarAuditableDao;
|
import com.baeldung.persistence.dao.common.IAuditOperations;
|
||||||
import org.baeldung.persistence.dao.IBarDao;
|
import com.baeldung.persistence.service.common.AbstractHibernateAuditableService;
|
||||||
import org.baeldung.persistence.dao.common.IAuditOperations;
|
import com.baeldung.persistence.dao.IBarAuditableDao;
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.dao.IBarDao;
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
import org.baeldung.persistence.service.IBarAuditableService;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.baeldung.persistence.service.common.AbstractHibernateAuditableService;
|
import com.baeldung.persistence.service.IBarAuditableService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
|
@ -1,10 +1,10 @@
|
||||||
package org.baeldung.persistence.service.impl;
|
package com.baeldung.persistence.service.impl;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IBarDao;
|
import com.baeldung.persistence.dao.IBarDao;
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.baeldung.persistence.service.IBarService;
|
import com.baeldung.persistence.service.IBarService;
|
||||||
import org.baeldung.persistence.service.common.AbstractJpaService;
|
import com.baeldung.persistence.service.common.AbstractJpaService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
|
@ -1,10 +1,10 @@
|
||||||
package org.baeldung.persistence.service.impl;
|
package com.baeldung.persistence.service.impl;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IBarDao;
|
import com.baeldung.persistence.dao.IBarDao;
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.baeldung.persistence.service.IBarService;
|
import com.baeldung.persistence.service.IBarService;
|
||||||
import org.baeldung.persistence.service.common.AbstractHibernateService;
|
import com.baeldung.persistence.service.common.AbstractHibernateService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
|
@ -1,11 +1,11 @@
|
||||||
package org.baeldung.persistence.service.impl;
|
package com.baeldung.persistence.service.impl;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IBarCrudRepository;
|
import com.baeldung.persistence.service.common.AbstractSpringDataJpaService;
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.dao.IBarCrudRepository;
|
||||||
import org.baeldung.persistence.service.IBarService;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.baeldung.persistence.service.common.AbstractSpringDataJpaService;
|
import com.baeldung.persistence.service.IBarService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.repository.CrudRepository;
|
import org.springframework.data.repository.CrudRepository;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package org.baeldung.persistence.service.impl;
|
package com.baeldung.persistence.service.impl;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IChildDao;
|
import com.baeldung.persistence.model.Child;
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.service.IChildService;
|
||||||
import org.baeldung.persistence.model.Child;
|
import com.baeldung.persistence.dao.IChildDao;
|
||||||
import org.baeldung.persistence.service.IChildService;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
import org.baeldung.persistence.service.common.AbstractHibernateService;
|
import com.baeldung.persistence.service.common.AbstractHibernateService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package org.baeldung.persistence.service.impl;
|
package com.baeldung.persistence.service.impl;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IFooAuditableDao;
|
import com.baeldung.persistence.dao.common.IAuditOperations;
|
||||||
import org.baeldung.persistence.dao.IFooDao;
|
import com.baeldung.persistence.service.IFooAuditableService;
|
||||||
import org.baeldung.persistence.dao.common.IAuditOperations;
|
import com.baeldung.persistence.service.common.AbstractHibernateAuditableService;
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.dao.IFooAuditableDao;
|
||||||
import org.baeldung.persistence.model.Foo;
|
import com.baeldung.persistence.dao.IFooDao;
|
||||||
import org.baeldung.persistence.service.IFooAuditableService;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
import org.baeldung.persistence.service.common.AbstractHibernateAuditableService;
|
import com.baeldung.persistence.model.Foo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
|
@ -1,10 +1,10 @@
|
||||||
package org.baeldung.persistence.service.impl;
|
package com.baeldung.persistence.service.impl;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IFooDao;
|
import com.baeldung.persistence.dao.IFooDao;
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
import org.baeldung.persistence.model.Foo;
|
import com.baeldung.persistence.model.Foo;
|
||||||
import org.baeldung.persistence.service.IFooService;
|
import com.baeldung.persistence.service.IFooService;
|
||||||
import org.baeldung.persistence.service.common.AbstractHibernateService;
|
import com.baeldung.persistence.service.common.AbstractHibernateService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
|
@ -1,10 +1,10 @@
|
||||||
package org.baeldung.persistence.service.impl;
|
package com.baeldung.persistence.service.impl;
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IParentDao;
|
import com.baeldung.persistence.model.Parent;
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
import com.baeldung.persistence.service.IParentService;
|
||||||
import org.baeldung.persistence.model.Parent;
|
import com.baeldung.persistence.dao.IParentDao;
|
||||||
import org.baeldung.persistence.service.IParentService;
|
import com.baeldung.persistence.dao.common.IOperations;
|
||||||
import org.baeldung.persistence.service.common.AbstractHibernateService;
|
import com.baeldung.persistence.service.common.AbstractHibernateService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
|
@ -1,28 +1,28 @@
|
||||||
package org.baeldung.spring;
|
package com.baeldung.spring;
|
||||||
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import com.baeldung.persistence.dao.impl.BarDao;
|
||||||
|
import com.baeldung.persistence.dao.impl.FooDao;
|
||||||
|
import com.baeldung.persistence.service.IBarAuditableService;
|
||||||
|
import com.baeldung.persistence.service.IFooAuditableService;
|
||||||
|
import com.baeldung.persistence.service.IFooService;
|
||||||
import org.apache.tomcat.dbcp.dbcp.BasicDataSource;
|
import org.apache.tomcat.dbcp.dbcp.BasicDataSource;
|
||||||
import org.baeldung.persistence.dao.IBarAuditableDao;
|
import com.baeldung.persistence.dao.IBarAuditableDao;
|
||||||
import org.baeldung.persistence.dao.IBarDao;
|
import com.baeldung.persistence.dao.IBarDao;
|
||||||
import org.baeldung.persistence.dao.IFooAuditableDao;
|
import com.baeldung.persistence.dao.IFooAuditableDao;
|
||||||
import org.baeldung.persistence.dao.IFooDao;
|
import com.baeldung.persistence.dao.IFooDao;
|
||||||
import org.baeldung.persistence.dao.impl.BarAuditableDao;
|
import com.baeldung.persistence.dao.impl.BarAuditableDao;
|
||||||
import org.baeldung.persistence.dao.impl.BarDao;
|
import com.baeldung.persistence.dao.impl.BarJpaDao;
|
||||||
import org.baeldung.persistence.dao.impl.BarJpaDao;
|
import com.baeldung.persistence.dao.impl.FooAuditableDao;
|
||||||
import org.baeldung.persistence.dao.impl.FooAuditableDao;
|
import com.baeldung.persistence.service.IBarService;
|
||||||
import org.baeldung.persistence.dao.impl.FooDao;
|
import com.baeldung.persistence.service.impl.BarAuditableService;
|
||||||
import org.baeldung.persistence.service.IBarAuditableService;
|
import com.baeldung.persistence.service.impl.BarJpaService;
|
||||||
import org.baeldung.persistence.service.IBarService;
|
import com.baeldung.persistence.service.impl.BarSpringDataJpaService;
|
||||||
import org.baeldung.persistence.service.IFooAuditableService;
|
import com.baeldung.persistence.service.impl.FooAuditableService;
|
||||||
import org.baeldung.persistence.service.IFooService;
|
import com.baeldung.persistence.service.impl.FooService;
|
||||||
import org.baeldung.persistence.service.impl.BarAuditableService;
|
|
||||||
import org.baeldung.persistence.service.impl.BarJpaService;
|
|
||||||
import org.baeldung.persistence.service.impl.BarSpringDataJpaService;
|
|
||||||
import org.baeldung.persistence.service.impl.FooAuditableService;
|
|
||||||
import org.baeldung.persistence.service.impl.FooService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
|
@ -45,10 +45,10 @@ import com.google.common.base.Preconditions;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableTransactionManagement
|
@EnableTransactionManagement
|
||||||
@EnableJpaRepositories(basePackages = { "org.baeldung.persistence" }, transactionManagerRef = "jpaTransactionManager")
|
@EnableJpaRepositories(basePackages = { "com.baeldung.persistence" }, transactionManagerRef = "jpaTransactionManager")
|
||||||
@EnableJpaAuditing
|
@EnableJpaAuditing
|
||||||
@PropertySource({ "classpath:persistence-mysql.properties" })
|
@PropertySource({ "classpath:persistence-mysql.properties" })
|
||||||
@ComponentScan({ "org.baeldung.persistence" })
|
@ComponentScan({ "com.baeldung.persistence" })
|
||||||
public class PersistenceConfig {
|
public class PersistenceConfig {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -62,7 +62,7 @@ public class PersistenceConfig {
|
||||||
public LocalSessionFactoryBean sessionFactory() {
|
public LocalSessionFactoryBean sessionFactory() {
|
||||||
final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
|
final LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
|
||||||
sessionFactory.setDataSource(restDataSource());
|
sessionFactory.setDataSource(restDataSource());
|
||||||
sessionFactory.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
|
sessionFactory.setPackagesToScan(new String[] { "com.baeldung.persistence.model" });
|
||||||
sessionFactory.setHibernateProperties(hibernateProperties());
|
sessionFactory.setHibernateProperties(hibernateProperties());
|
||||||
|
|
||||||
return sessionFactory;
|
return sessionFactory;
|
||||||
|
@ -72,7 +72,7 @@ public class PersistenceConfig {
|
||||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
|
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
|
||||||
final LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
|
final LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
|
||||||
emf.setDataSource(restDataSource());
|
emf.setDataSource(restDataSource());
|
||||||
emf.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
|
emf.setPackagesToScan(new String[] { "com.baeldung.persistence.model" });
|
||||||
|
|
||||||
final JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
|
final JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
|
||||||
emf.setJpaVendorAdapter(vendorAdapter);
|
emf.setJpaVendorAdapter(vendorAdapter);
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.spring;
|
package com.baeldung.spring;
|
||||||
|
|
||||||
import org.springframework.context.annotation.ComponentScan;
|
import org.springframework.context.annotation.ComponentScan;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
@ -7,7 +7,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableTransactionManagement
|
@EnableTransactionManagement
|
||||||
@ComponentScan({ "org.baeldung.persistence.dao", "org.baeldung.persistence.service" })
|
@ComponentScan({ "com.baeldung.persistence.dao", "com.baeldung.persistence.service" })
|
||||||
@ImportResource({ "classpath:hibernate4Config.xml" })
|
@ImportResource({ "classpath:hibernate4Config.xml" })
|
||||||
public class PersistenceXmlConfig {
|
public class PersistenceXmlConfig {
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.dao;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IAuditOperations;
|
|
||||||
import org.baeldung.persistence.model.Bar;
|
|
||||||
|
|
||||||
public interface IBarAuditableDao extends IBarDao, IAuditOperations<Bar> {
|
|
||||||
//
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.dao;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
|
||||||
import org.baeldung.persistence.model.Bar;
|
|
||||||
|
|
||||||
public interface IBarDao extends IOperations<Bar> {
|
|
||||||
//
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.dao;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
|
||||||
import org.baeldung.persistence.model.Child;
|
|
||||||
|
|
||||||
public interface IChildDao extends IOperations<Child> {
|
|
||||||
//
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.dao;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IAuditOperations;
|
|
||||||
import org.baeldung.persistence.model.Foo;
|
|
||||||
|
|
||||||
public interface IFooAuditableDao extends IFooDao, IAuditOperations<Foo> {
|
|
||||||
//
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.dao;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
|
||||||
import org.baeldung.persistence.model.Foo;
|
|
||||||
|
|
||||||
public interface IFooDao extends IOperations<Foo> {
|
|
||||||
//
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.dao;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
|
||||||
import org.baeldung.persistence.model.Parent;
|
|
||||||
|
|
||||||
public interface IParentDao extends IOperations<Parent> {
|
|
||||||
//
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
package org.baeldung.persistence.dao.impl;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IChildDao;
|
|
||||||
import org.baeldung.persistence.dao.common.AbstractHibernateDao;
|
|
||||||
import org.baeldung.persistence.model.Child;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public class ChildDao extends AbstractHibernateDao<Child>implements IChildDao {
|
|
||||||
|
|
||||||
public ChildDao() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
setClazz(Child.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
// API
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
package org.baeldung.persistence.dao.impl;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IFooAuditableDao;
|
|
||||||
import org.baeldung.persistence.dao.common.AbstractHibernateAuditableDao;
|
|
||||||
import org.baeldung.persistence.model.Foo;
|
|
||||||
|
|
||||||
public class FooAuditableDao extends AbstractHibernateAuditableDao<Foo> implements IFooAuditableDao {
|
|
||||||
|
|
||||||
public FooAuditableDao() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
setClazz(Foo.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
// API
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
package org.baeldung.persistence.dao.impl;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.IParentDao;
|
|
||||||
import org.baeldung.persistence.dao.common.AbstractHibernateDao;
|
|
||||||
import org.baeldung.persistence.model.Parent;
|
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
|
|
||||||
@Repository
|
|
||||||
public class ParentDao extends AbstractHibernateDao<Parent>implements IParentDao {
|
|
||||||
|
|
||||||
public ParentDao() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
setClazz(Parent.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
// API
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.service;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IAuditOperations;
|
|
||||||
import org.baeldung.persistence.model.Bar;
|
|
||||||
|
|
||||||
public interface IBarAuditableService extends IBarService, IAuditOperations<Bar> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.service;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
|
||||||
import org.baeldung.persistence.model.Bar;
|
|
||||||
|
|
||||||
public interface IBarService extends IOperations<Bar> {
|
|
||||||
//
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.service;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
|
||||||
import org.baeldung.persistence.model.Child;
|
|
||||||
|
|
||||||
public interface IChildService extends IOperations<Child> {
|
|
||||||
//
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.service;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IAuditOperations;
|
|
||||||
import org.baeldung.persistence.model.Foo;
|
|
||||||
|
|
||||||
public interface IFooAuditableService extends IFooService, IAuditOperations<Foo> {
|
|
||||||
//
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.service;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
|
||||||
import org.baeldung.persistence.model.Foo;
|
|
||||||
|
|
||||||
public interface IFooService extends IOperations<Foo> {
|
|
||||||
//
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package org.baeldung.persistence.service;
|
|
||||||
|
|
||||||
import org.baeldung.persistence.dao.common.IOperations;
|
|
||||||
import org.baeldung.persistence.model.Parent;
|
|
||||||
|
|
||||||
public interface IParentService extends IOperations<Parent> {
|
|
||||||
//
|
|
||||||
}
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
|
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
|
||||||
<property name="dataSource" ref="dataSource"/>
|
<property name="dataSource" ref="dataSource"/>
|
||||||
<property name="packagesToScan" value="org.baeldung.persistence.model"/>
|
<property name="packagesToScan" value="com.baeldung.persistence.model"/>
|
||||||
<property name="hibernateProperties">
|
<property name="hibernateProperties">
|
||||||
<props>
|
<props>
|
||||||
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
|
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package org.baeldung.persistence;
|
package com.baeldung.persistence;
|
||||||
|
|
||||||
import org.baeldung.persistence.hibernate.FooPaginationPersistenceIntegrationTest;
|
import com.baeldung.persistence.hibernate.FooPaginationPersistenceIntegrationTest;
|
||||||
import org.baeldung.persistence.hibernate.FooSortingPersistenceServiceTest;
|
import com.baeldung.persistence.hibernate.FooSortingPersistenceServiceTest;
|
||||||
import org.baeldung.persistence.service.FooServiceBasicPersistenceIntegrationTest;
|
import com.baeldung.persistence.service.FooServicePersistenceIntegrationTest;
|
||||||
import org.baeldung.persistence.service.FooServicePersistenceIntegrationTest;
|
import com.baeldung.persistence.service.FooServiceBasicPersistenceIntegrationTest;
|
||||||
import org.baeldung.persistence.service.ParentServicePersistenceIntegrationTest;
|
import com.baeldung.persistence.service.ParentServicePersistenceIntegrationTest;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Suite;
|
import org.junit.runners.Suite;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.audit;
|
package com.baeldung.persistence.audit;
|
||||||
|
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.Suite;
|
import org.junit.runners.Suite;
|
|
@ -1,15 +1,15 @@
|
||||||
package org.baeldung.persistence.audit;
|
package com.baeldung.persistence.audit;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.model.Foo;
|
||||||
import org.baeldung.persistence.model.Foo;
|
import com.baeldung.persistence.service.IBarAuditableService;
|
||||||
import org.baeldung.persistence.service.IBarAuditableService;
|
import com.baeldung.persistence.service.IFooAuditableService;
|
||||||
import org.baeldung.persistence.service.IFooAuditableService;
|
import com.baeldung.spring.PersistenceConfig;
|
||||||
import org.baeldung.spring.PersistenceConfig;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.audit;
|
package com.baeldung.persistence.audit;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
@ -7,10 +7,10 @@ import static org.junit.Assert.assertTrue;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.EntityManagerFactory;
|
import javax.persistence.EntityManagerFactory;
|
||||||
|
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.baeldung.persistence.model.Bar.OPERATION;
|
import com.baeldung.persistence.model.Bar.OPERATION;
|
||||||
import org.baeldung.persistence.service.IBarService;
|
import com.baeldung.persistence.service.IBarService;
|
||||||
import org.baeldung.spring.PersistenceConfig;
|
import com.baeldung.spring.PersistenceConfig;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.audit;
|
package com.baeldung.persistence.audit;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
@ -6,9 +6,9 @@ import static org.junit.Assert.assertTrue;
|
||||||
import javax.persistence.EntityManager;
|
import javax.persistence.EntityManager;
|
||||||
import javax.persistence.EntityManagerFactory;
|
import javax.persistence.EntityManagerFactory;
|
||||||
|
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.baeldung.persistence.service.IBarService;
|
import com.baeldung.persistence.service.IBarService;
|
||||||
import org.baeldung.spring.PersistenceConfig;
|
import com.baeldung.spring.PersistenceConfig;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
|
@ -1,9 +1,9 @@
|
||||||
package org.baeldung.persistence.hibernate;
|
package com.baeldung.persistence.hibernate;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.model.Foo;
|
||||||
import org.baeldung.persistence.model.Foo;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.baeldung.persistence.hibernate;
|
package com.baeldung.persistence.hibernate;
|
||||||
|
|
||||||
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
|
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
|
||||||
import static org.hamcrest.Matchers.hasSize;
|
import static org.hamcrest.Matchers.hasSize;
|
||||||
|
@ -7,9 +7,9 @@ import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.baeldung.persistence.model.Foo;
|
import com.baeldung.persistence.model.Foo;
|
||||||
import org.baeldung.persistence.service.IFooService;
|
import com.baeldung.persistence.service.IFooService;
|
||||||
import org.baeldung.spring.PersistenceConfig;
|
import com.baeldung.spring.PersistenceConfig;
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.hibernate.ScrollMode;
|
import org.hibernate.ScrollMode;
|
|
@ -1,13 +1,13 @@
|
||||||
package org.baeldung.persistence.hibernate;
|
package com.baeldung.persistence.hibernate;
|
||||||
|
|
||||||
import static org.junit.Assert.assertNull;
|
import static org.junit.Assert.assertNull;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.baeldung.persistence.model.Bar;
|
import com.baeldung.persistence.model.Bar;
|
||||||
import org.baeldung.persistence.model.Foo;
|
import com.baeldung.persistence.model.Foo;
|
||||||
import org.baeldung.spring.PersistenceConfig;
|
import com.baeldung.spring.PersistenceConfig;
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
import org.hibernate.NullPrecedence;
|
import org.hibernate.NullPrecedence;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
|
@ -1,10 +1,9 @@
|
||||||
package org.baeldung.persistence.service;
|
package com.baeldung.persistence.service;
|
||||||
|
|
||||||
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
|
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
|
||||||
|
|
||||||
import org.baeldung.persistence.model.Foo;
|
import com.baeldung.persistence.model.Foo;
|
||||||
import org.baeldung.persistence.service.IFooService;
|
import com.baeldung.spring.PersistenceConfig;
|
||||||
import org.baeldung.spring.PersistenceConfig;
|
|
||||||
import org.hibernate.Session;
|
import org.hibernate.Session;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
|
@ -1,9 +1,9 @@
|
||||||
package org.baeldung.persistence.service;
|
package com.baeldung.persistence.service;
|
||||||
|
|
||||||
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
|
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
|
||||||
|
|
||||||
import org.baeldung.persistence.model.Foo;
|
import com.baeldung.persistence.model.Foo;
|
||||||
import org.baeldung.spring.PersistenceConfig;
|
import com.baeldung.spring.PersistenceConfig;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
|
@ -1,8 +1,8 @@
|
||||||
package org.baeldung.persistence.service;
|
package com.baeldung.persistence.service;
|
||||||
|
|
||||||
import org.baeldung.persistence.model.Child;
|
import com.baeldung.persistence.model.Child;
|
||||||
import org.baeldung.persistence.model.Parent;
|
import com.baeldung.persistence.model.Parent;
|
||||||
import org.baeldung.spring.PersistenceConfig;
|
import com.baeldung.spring.PersistenceConfig;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
Loading…
Reference in New Issue