Skip to content

Vaultaire Maven Central Build Status

Query DSL and data access utilities for Corda developers.

Query DSL

Use DSL will make your queries much easier to read and maintain. Each query DSL is automatically generated and maintaind for you based on your states.

al query = booksQuery {
    and {
        // Check publisher?
        if(checkPublisher) fields.publisher `==` "Corda Books Ltd."
        or {
            fields.title  `==` "A book on Corda"
   `!=` "John Doe"
    orderBy {
        fields.title sort DESC

For more info on query DSL, checkout

State Services

Vaultaire’s annotation processor will automatically subclass ExtendedStateService to generate an Fields aware state service service per annotated element. The generated service name is “${contractStateTypeName}Service”. Usage example:

// Create an instance of the generated service type
val bookStateService = BookStateService(
    serviceHub,        // Service hub or RPC ops
    serviceDefaults)   // Optional: criteria, paging, sort defaults

// Load a book
// Try finding one by ISBN

// query the vault for books
val searchResults = bookStateService.queryBy(
    criteria, paging, Pair("published", DESC), Pair("title", DESC))

For more info on state services, checkout

Other Utils

Vaultaire includes a few other utilities like annotations to generate Data Transfer Objects for your contract states and responding flows from commonly used supertypes.

For more info on these utilities, checkout