-
Notifications
You must be signed in to change notification settings - Fork 371
Open
Labels
type: enhancementA general enhancementA general enhancement
Description
LaoTsing opened DATAJDBC-468 and commented
We can use annotations to insert value as any SQL function:
@UpdateStrategy
(JdbcStrategy.UpdateIsNotNull)
public class DocEntity {
@Id
private Long id;
private String english;
@Fun
("translate('french', english)") private String french;
}
in annotation Fun("translate('french', ?)") we can select character "?" and get value from any primitive type of "french" field
then repository.save(doc) with english == null generate:
update doc set ``french=translate('french', ``english``) where id=?
this will greatly simplify the logic and source code.
In SELECT case, the annotated functions can reveal their full potential
Issue Links:
- DATAJDBC-397 SpEL support for
@Query
annotation
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement