service-layer local type inference changes (#1034)

local variable type inference for service-layer design patterns
This commit is contained in:
GVSharma
2019-10-26 21:05:32 +05:30
committed by Ilkka Seppälä
parent 70ddeaa194
commit f7a53f2d17
5 changed files with 45 additions and 45 deletions
@@ -57,12 +57,12 @@ public abstract class DaoBaseImpl<E extends BaseEntity> implements Dao<E> {
@Override
public E find(Long id) {
Session session = getSessionFactory().openSession();
var session = getSessionFactory().openSession();
Transaction tx = null;
E result = null;
try {
tx = session.beginTransaction();
Criteria criteria = session.createCriteria(persistentClass);
var criteria = session.createCriteria(persistentClass);
criteria.add(Restrictions.idEq(id));
result = (E) criteria.uniqueResult();
tx.commit();
@@ -79,7 +79,7 @@ public abstract class DaoBaseImpl<E extends BaseEntity> implements Dao<E> {
@Override
public void persist(E entity) {
Session session = getSessionFactory().openSession();
var session = getSessionFactory().openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();
@@ -97,7 +97,7 @@ public abstract class DaoBaseImpl<E extends BaseEntity> implements Dao<E> {
@Override
public E merge(E entity) {
Session session = getSessionFactory().openSession();
var session = getSessionFactory().openSession();
Transaction tx = null;
E result = null;
try {
@@ -117,7 +117,7 @@ public abstract class DaoBaseImpl<E extends BaseEntity> implements Dao<E> {
@Override
public void delete(E entity) {
Session session = getSessionFactory().openSession();
var session = getSessionFactory().openSession();
Transaction tx = null;
try {
tx = session.beginTransaction();
@@ -135,7 +135,7 @@ public abstract class DaoBaseImpl<E extends BaseEntity> implements Dao<E> {
@Override
public List<E> findAll() {
Session session = getSessionFactory().openSession();
var session = getSessionFactory().openSession();
Transaction tx = null;
List<E> result = null;
try {