Support all predicates for PostgreSQL JSONB type, JsonNode in model automatically converted to JSONB and back
SpEL Expression type in model automatically converted to TEXT type of PostgreSQL and back
First level cache based on Caffeine with guided expire access and size for each cache from application.properties
Convert first level cache to second level cache by property in application.properties:spring.r2dbc.dsl.secondCache = true
then subscribe to change from database
Support second level cache from any CacheManager implementation and may be both working with subscribe to change from database. Enabled by:spring.r2dbc.dsl.cacheManager = true
Full manage of cache from repository methods: evict(Dsl dsl), put(Dsl dsl, T value) and get(Dsl dsl): T
Dsl support all SQL predicates:=, >, <, >=, ⇐, like, in, not in, is true, is false, is null, is not null
, also can operate with LocalDate, LocalDateTime, OffsetDateTime, ZonedDateTime types ascreatedAt>=2000-10-31T01:30.000-05:00
orcreatedAt==2000-10-31T01:30.001
orcreatedAt<<2000-10-31T01:30
Ability to choose resulted columns infindAll(dsl: Dsl)
andfindOne(dsl: Dsl)
fromdsl.fields("id", "name")
or in urlfields=id,name
Joins to any tables 'tableName.type' and model must havetableNameId
field and build criteria on joined columnstableName.type==space
, also can select joined columns in resultfields=id,name,type
Annotation@Id
is not required in model, because column with nameid
in 99% of all tables has nameid
Annotation@Table
is not required in model, because table name in 99% of all tables equals model class name, the camel name automatic convert to sql underlined
Any reserved database words can be used by column name
Repositorylistener
method subscribe to listen of all changes of table from database in realtime overFlux<Notification>
(Postgres only)
Ranked full text search by fieldtsv
as default with RUM index operator inDsl.fts
method (Postgres only)
Paging and Sorting full support with ordering in several columns at once
Utility classFastMethodInvoker
is a modern reflection access to object properties, in performance comparable to direct access.
Utility classJsonUtils
is a powerful utils to flexibility manage any json operations around JsonNode type.
Utility classR2dbcUtils
can create repository from url:R2dbcUtils.getRepository("r2dbc:postgresql://postgres:postgres@localhost/abac_rules", AbacRepository::class)
, also havefun saveBatch(models: Iterable<T>): Flux<Integer>
method for call native Postgres driver batch operation for massive insert as one sql.
Field with @Equality annotation on each update the value is comparing with previous value from database and throw exception is not equals, also can set in application.properties:spring.r2dbc.dsl.equality = tenantId,userId
Field with @ReadOnly or @CreatedBy annotation on each update the value getting from previous record if not null and setting to current record without comparing, also can set in application.properties:spring.r2dbc.dsl.readOnly = tenantId,userId
Field with namecreatedAt
with typeZonedDateTime
,OffsetDateTime
orLocalDateTime
on update using @CreatedDate annotation and @ReadOnly annotation logic, also can be set in application.properties:spring.r2dbc.dsl.createdAt = createdAt
Field with nameupdatedAt
and typeZonedDateTime
,OffsetDateTime
orLocalDateTime
on update using @LastModifiedDate annotation logic, also can be set in application.properties:spring.r2dbc.dsl.updatedAt = updatedAt
Field with nameversion
do not required @Version annotation if it has typeLong
,Integer
,ZonedDateTime
,OffsetDateTime
orLocalDateTime
for optimistic locking, also can be set in application.properties:spring.r2dbc.dsl.version = counter,innerIndex
Fields with namecreatedBy
,updatedBy
or annotated by @CreatedBy, @UpdatedBy on create or update set current security userId, also fields can be set in application.properties:spring.r2dbc.dsl.createdBy = createdBy
,spring.r2dbc.dsl.updatedBy = updatedBy
ApplicationContext implementation asBeans
utility class with caching resolved beans and registering new beans as ect or recreate by classname
Utility class SqlField constants a most used sql-names in tables for no handwriting names
Integration with Spring Security via AuthenticationIdentifierResolver Bean to get current userId