Skip to content

Provide support when accessing XML databases like eXist-db with Java and XQuery

License

Notifications You must be signed in to change notification settings

datenkollektiv/spring-data-xml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-data-xml

Provide support when accessing XML databases like eXist with Java and XQuery

The following Spring integration tests demonstrates the simple use-case of an empty XQuery sequence:

@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = ExistConfiguration.class)
class SimpleExistXQJRepositoryTests {

    @Inject
    private SimpleXQJRepository<Integer> existRepository;

    @Test
    void emptySequence() {
        Stream<Integer> result = existRepository.execute("()");

        assertEquals(0, result.count());
    }
}

Running the integration tests against eXist-db

Prerequisites

  • Install and start an eXist-db locally.

Tip: Please refer to eXist - Kick-start Development with Docker for a non-invasive setup with Docker.

  • Create the test collection /data/book with eXide.
  • Download exist-xqj-api-1.0.1.jar from eXist XQJ API and put the Java library into the lib folder.

Action

The standard Gradle task test will run the integration tests.

$ ./gradlew test

Hint: This repository is a companion of the blog post Building a Simple eXist Repository on Top of Spring Data which describes the internals of this library in more detail.

About

Provide support when accessing XML databases like eXist-db with Java and XQuery

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages