-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Description
As suggested in issue - #238 . I have exclude hibernate and use eclipse library for jpa implementation . We had implement custom function which supported in hibernate and how we can implement same in eclipse link
Implementation with Hibernate :
import org.hibernate.boot.MetadataBuilder;
import org.hibernate.dialect.function.SQLFunctionTemplate;
import org.hibernate.type.StandardBasicTypes;
public class TestMetadataBuilderContributor {
public static void commonSqlFunctions(MetadataBuilder metadataBuilder) {
metadataBuilder.applySqlFunction("cast_as_time", new SQLFunctionTemplate(StandardBasicTypes.TIME,
"cast(?1 as time)"));
metadataBuilder.applySqlFunction("cast_as_date", new SQLFunctionTemplate(StandardBasicTypes.DATE,
"cast(?1 as date)"));
}
}
olingo-jpa-processor-v4 - Custom implementation in JPAOperationConverter.class
case DATE:
return cb.function("cast_as_date", Date.class, (Expression<Timestamp>) jpaFunction.getParameter(0).get());
I have gone through eclipse link official document , I have found something .
Can you please provide how we can implement database specific custom function in jpa processor side using eclipse link?
Metadata
Metadata
Assignees
Labels
No labels