Skip to content

Commit

Permalink
Removed solr-dataimporthandler as it conflicted with ANTLR version (a…
Browse files Browse the repository at this point in the history
…nd is hopefully not used)
  • Loading branch information
Skaar, Bjørn-Andre committed Dec 15, 2023
1 parent 2254ce6 commit 2d7e501
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
import java.util.List;

import jakarta.persistence.Column;
import jakarta.persistence.Convert;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.Index;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import no.ssb.klass.core.util.TranslatablePersistenceConverter;
import org.hibernate.Hibernate;

import no.ssb.klass.core.util.Translatable;
Expand All @@ -23,6 +25,7 @@
public class ClassificationFamily extends BaseEntity {
public static final String BASE_ICON_PATH = "/icons/";
@Column(nullable = false)
@Convert(converter = TranslatablePersistenceConverter.class)
private final Translatable name;
@Column(nullable = false)
private final String iconName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,52 +41,52 @@ public interface ClassificationSeriesRepository extends JpaRepository<Classifica
Set<String> findResponsibleSectionsWithPublishedVersions();

@Query(value = "select count(*) from ClassificationSeries classification join classification.contactPerson user where "
+ "classification.deleted is false" + CHECKPARAMETERS)
+ "classification.deleted = false" + CHECKPARAMETERS)
int finNumberOfClassifications(@Param("classificationType") ClassificationType classificationType,
@Param("section") String section);

@Query(value = "select count(distinct classification.id) from ClassificationVersion version join version.classification classification join "
+ "classification.contactPerson user where classification.deleted is false and version.deleted is false "
+ "and (version.published.published_no is true or "
+ "version.published.published_nn is true or version.published.published_en is true)" + CHECKPARAMETERS)
+ "classification.contactPerson user where classification.deleted = false and version.deleted = false "
+ "and (version.published.published_no = true or "
+ "version.published.published_nn = true or version.published.published_en = true)" + CHECKPARAMETERS)
int findNumberOfPublishedClassifications(@Param("classificationType") ClassificationType classificationType,
@Param("section") String section);

@Query(value = "select count(version.id) from ClassificationVersion version join version.classification classification join "
+ "classification.contactPerson user where classification.deleted is false and version.deleted is false "
+ "and (version.published.published_no is true "
+ "or version.published.published_nn is true or version.published.published_en is true)" + CHECKPARAMETERS)
+ "classification.contactPerson user where classification.deleted = false and version.deleted = false "
+ "and (version.published.published_no = true "
+ "or version.published.published_nn = true or version.published.published_en = true)" + CHECKPARAMETERS)
int findNumberOfPublishedVersionsAnyLanguages(@Param("classificationType") ClassificationType classificationType,
@Param("section") String section);

@Query(value = "select count(version.id) from ClassificationVersion version join version.classification classification join "
+ "classification.contactPerson user where classification.deleted is false and version.deleted is false "
+ "and version.published.published_no is true "
+ "and version.published.published_nn is true and version.published.published_en is true" + CHECKPARAMETERS)
+ "classification.contactPerson user where classification.deleted = false and version.deleted = false "
+ "and version.published.published_no = true "
+ "and version.published.published_nn = true and version.published.published_en = true" + CHECKPARAMETERS)
int findNumberOfPublishedVersionsAllLanguages(@Param("classificationType") ClassificationType classificationType,
@Param("section") String section);

@Query(value = "select new no.ssb.klass.core.service.dto.ClassificationReportDto(classification, user) "
+ "from ClassificationSeries classification join classification.contactPerson user where "
+ "classification.deleted is false" + CHECKPARAMETERS + " order by classification.id")
+ "classification.deleted = false" + CHECKPARAMETERS + " order by classification.id")
List<ClassificationReportDto> getClassificationReport(
@Param("classificationType") ClassificationType classificationType,
@Param("section") String section);

@Query(value = "select new no.ssb.klass.core.service.dto.ClassificationReportDto(classification, user) "
+ "from ClassificationVersion version join version.classification classification join "
+ "classification.contactPerson user where classification.deleted is false and (version.published.published_no is true or "
+ "version.published.published_nn is true or version.published.published_en is true)" + CHECKPARAMETERS
+ "classification.contactPerson user where classification.deleted = false and (version.published.published_no = true or "
+ "version.published.published_nn = true or version.published.published_en = true)" + CHECKPARAMETERS
+ " order by classification.id")
List<ClassificationReportDto> getPublishedClassificationReport(
@Param("classificationType") ClassificationType classificationType,
@Param("section") String section);

@Query(value = "select new no.ssb.klass.core.service.dto.ClassificationVersionReportDto(version, classification, user) "
+ "from ClassificationVersion version join version.classification classification join "
+ "classification.contactPerson user where classification.deleted is false and version.deleted is false "
+ "and (version.published.published_no is true "
+ "or version.published.published_nn is true or version.published.published_en is true)" + CHECKPARAMETERS
+ "classification.contactPerson user where classification.deleted = false and version.deleted = false "
+ "and (version.published.published_no = true "
+ "or version.published.published_nn = true or version.published.published_en = true)" + CHECKPARAMETERS
+ " order by version.id")
List<ClassificationVersionReportDto> getPublishedVersionsAnyLanguages(
@Param("classificationType") ClassificationType classificationType,
Expand All @@ -96,20 +96,20 @@ List<ClassificationVersionReportDto> getPublishedVersionsAnyLanguages(
+ "from ClassificationVersion version "
+ " join version.classification classification "
+ " join classification.contactPerson user "
+ "where classification.deleted is false and version.deleted is false "
+ " and version.published.published_no is true "
+ " and version.published.published_nn is true and version.published.published_en is true "
+ "where classification.deleted = false and version.deleted = false "
+ " and version.published.published_no = true "
+ " and version.published.published_nn = true and version.published.published_en = true "
+ CHECKPARAMETERS
+ " order by version.id")
List<ClassificationVersionReportDto> getPublishedVersionsAllLanguages(
@Param("classificationType") ClassificationType classificationType,
@Param("section") String section);

@Query(value = "select count(id) from ClassificationSeries where deleted is false and :user = contactPerson")
@Query(value = "select count(id) from ClassificationSeries where deleted = false and :user = contactPerson")
int getNumberOfClassificationForUser(@Param("user") User user);

@Modifying
@Query("update ClassificationSeries set contactPerson = :newUser where contactPerson = :oldUser and deleted is false")
@Query("update ClassificationSeries set contactPerson = :newUser where contactPerson = :oldUser and deleted = false")
void updateUser(@Param("oldUser") User oldUser, @Param("newUser") User newUser);

ClassificationSeries findByNameNoIgnoreCase(@Param("name") String name);
Expand All @@ -130,6 +130,6 @@ List<ClassificationVersionReportDto> getPublishedVersionsAllLanguages(
void updateClassificationLastModified(@Param("classificationId") Long classificationId,
@Param("timeStamp") Date timeStamp);

@Query("select distinct statisticalUnits from ClassificationSeries where deleted is false")
@Query("select distinct statisticalUnits from ClassificationSeries where deleted = false")
List<StatisticalUnit> findAllClassificationStatisticalUnits();
}

0 comments on commit 2d7e501

Please sign in to comment.