Spring JPA. @ColumnTransformer execute function without argument

I have a Sybase database. I want one of the fields when inserting into the database to use the getutcdate() function. Unfortunately, the implementation through the query repository does not suit me. Since the entities are related and writing an sql query is quite problematic. At the moment I'm looking at the solution through @ColumnTransformer, but is it possible to somehow not pass a parameter there (?) ?

    @Column(name = "Date")
    @ColumnTransformer(write = "getutcdate()")
    private OffsetDateTime offsetDateTime;

With such use an error occurs:

@WriteExpression must contain exactly one value placeholder ('?') character: property [offsetDateTime] and column [Date]

Ответы (0 шт):