Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRY-321: move dialect to common-service & fix query #8

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion java/admin/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spring:
default_schema: public
jdbc.lob.non_contextual_creation: true # fix for Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.
format_sql: true
dialect: org.hibernate.dialect.PostgreSQL10Dialect
dialect: com.exadel.frs.commonservice.config.CustomizedPostgreSQL10Dialect
hibernate:
ddl-auto: none
database: postgresql
Expand Down
2 changes: 1 addition & 1 deletion java/admin/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spring:
default_schema: public
jdbc.lob.non_contextual_creation: true # fix for Caused by: java.sql.SQLFeatureNotSupportedException: Method org.postgresql.jdbc.PgConnection.createClob() is not yet implemented.
format_sql: true
dialect: org.hibernate.dialect.PostgreSQL10Dialect
dialect: com.exadel.frs.commonservice.config.CustomizedPostgreSQL10Dialect
hibernate:
ddl-auto: none
database: postgresql
Expand Down
2 changes: 1 addition & 1 deletion java/api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spring:
order_updates: true
batch_versioned_data: true
format_sql: true
dialect: com.exadel.frs.core.trainservice.config.repository.CustomizedPostgreSQL10Dialect
dialect: com.exadel.frs.commonservice.config.CustomizedPostgreSQL10Dialect
hibernate:
ddl-auto: none
database: postgresql
Expand Down
2 changes: 1 addition & 1 deletion java/api/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spring:
order_updates: true
batch_versioned_data: true
format_sql: true
dialect: com.exadel.frs.core.trainservice.config.repository.CustomizedPostgreSQL10Dialect
dialect: com.exadel.frs.commonservice.config.CustomizedPostgreSQL10Dialect
show_sql: true

environment:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.exadel.frs.core.trainservice.config.repository;
package com.exadel.frs.commonservice.config;

import org.hibernate.dialect.PostgreSQL10Dialect;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.exadel.frs.core.trainservice.config.repository;
package com.exadel.frs.commonservice.config;

import com.vladmihalcea.hibernate.type.json.JsonBinaryType;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Long countBySubjectApiKeyNotEqAndCalculatorNotEq(@Param("apiKey") String apiKey,
" FROM Embedding e " +
"LEFT OUTER JOIN ImageAttributes ia ON e.img.id = ia.img.id " + // left join to include embeddings without image attributes
"WHERE e.subject.apiKey = :apiKey " +
"AND (:subjectName IS NULL OR e.subject.subjectName = :subjectName) " +
" AND (cast(:subjectName as string) is null or e.subject.subjectName = :subjectName)" +
"GROUP BY e.id, e.subject.subjectName"
)
Page<ExpandedEmbeddingProjection> fetchExpandedEmbeddings(String apiKey, String subjectName, Pageable pageable);
Expand Down
Loading