Skip to content

Commit

Permalink
Merge pull request #7 from smartSenseSolutions/6-add-generic-support-…
Browse files Browse the repository at this point in the history
…in-specificationutils

fix: generic issue in specification utils
  • Loading branch information
dilipdhankecha2530 authored Mar 8, 2024
2 parents 305ec14 + 9c9ea69 commit 991309d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ public abstract class BaseService<E extends BaseEntity, ID> {
/**
* Method needs to Override by each service which extends BaseService.
*
* @return Specification of @{@link jakarta.persistence.Entity} class
* @return Specification of @{@link BaseEntity} class
*/
protected abstract SpecificationUtil<E> getSpecificationUtil();
protected SpecificationUtil<E> getSpecificationUtil(){
return new SpecificationUtil<>();
};

/**
* Method used for save entity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.smartsensesolutions.java.commons.specification;

import com.smartsensesolutions.java.commons.base.entity.BaseEntity;
import com.smartsensesolutions.java.commons.filter.FilterCriteria;
import jakarta.persistence.criteria.*;
import org.springframework.data.jpa.domain.Specification;
Expand All @@ -31,7 +32,7 @@
* @param <T> - Indicates @{@link jakarta.persistence.Entity} class.
*/
@Component
public class SpecificationUtil<T> {
public class SpecificationUtil<T extends BaseEntity> {
private static String getContainsValue(String value) {
return "%".concat(value).concat("%");
}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ packageVersion=0.0.1
springBootVersion=3.0.6
springDependencyManagementVersion=1.1.0
#Commons-Dao version Details
commonDaoVersion=0.0.11
commonDaoVersion=0.0.12
#Sample version Details
sampleVersion=0.0.1
#OSSRH and GPG Signing configuration
signing.keyId=
signing.password=
signing.secretKeyRingFile=
ossrhUsername=
ossrhPassword=
ossrhPassword=

0 comments on commit 991309d

Please sign in to comment.