Skip to content

Commit

Permalink
Remove association to BaseJpaEntity in BaseDao
Browse files Browse the repository at this point in the history
  • Loading branch information
Idane committed Aug 4, 2021
1 parent 4eea6fa commit 18df0e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.antelopesystem.crudframework.jpa.dao;

import com.antelopesystem.crudframework.jpa.annotation.CrudJoinType;
import com.antelopesystem.crudframework.jpa.model.BaseJpaEntity;
import com.antelopesystem.crudframework.model.BaseCrudEntity;
import com.antelopesystem.crudframework.model.PersistentEntity;
import com.antelopesystem.crudframework.modelfilter.*;
import com.antelopesystem.crudframework.modelfilter.enums.FilterFieldOperation;
Expand Down Expand Up @@ -65,7 +65,7 @@ public <T> List<T> findAll(Class<T> clazz) {
* @param id unique identificator
* @return entity with given class and UUID.
*/
public <T extends BaseJpaEntity> T findObject(Class<T> clazz, Serializable id) {
public <T extends BaseCrudEntity<?>> T findObject(Class<T> clazz, Serializable id) {
return (T) getCurrentSession().get(clazz, id);
}

Expand All @@ -76,7 +76,7 @@ public <T extends BaseJpaEntity> T findObject(Class<T> clazz, Serializable id) {
* @param ids a list of UUIDs
* @return a list of entities with given class and matching UUID
*/
public <T extends BaseJpaEntity> List<T> findObjectByIds(Class<T> clazz, Serializable ids[]) {
public <T extends BaseCrudEntity<?>> List<T> findObjectByIds(Class<T> clazz, Serializable ids[]) {
return (List<T>) getCurrentSession().createCriteria(clazz).add(Restrictions.in("id", ids)).list();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.antelopesystem.crudframework.jpa.dao;

import com.antelopesystem.crudframework.jpa.model.BaseJpaEntity;
import com.antelopesystem.crudframework.model.BaseCrudEntity;

import java.io.Serializable;

Expand All @@ -16,7 +16,7 @@ public interface BaseDao {
* @param id UID of entity.
* @return found entity
*/
<T extends BaseJpaEntity> T findObject(Class<T> clazz, Serializable id);
<T extends BaseCrudEntity<?>> T findObject(Class<T> clazz, Serializable id);

/**
* Persist entity to DB.
Expand Down

0 comments on commit 18df0e1

Please sign in to comment.