Giter Site home page Giter Site logo

marklogic / java-client-api Goto Github PK

View Code? Open in Web Editor NEW
57.0 37.0 75.0 39.33 MB

Java client for the MarkLogic enterprise NoSQL database

Home Page: https://docs.marklogic.com/guide/java

License: Apache License 2.0

Java 97.18% XSLT 0.13% Shell 0.02% XQuery 0.56% JavaScript 0.63% HTML 0.01% Kotlin 1.48%
marklogic java database nosql sparql xquery javascript json xml

java-client-api's Introduction

GitHub release GitHub last commit License Known Vulnerabilities

The MarkLogic Java Client

The MarkLogic Java Client makes it easy to write, read, delete, and find documents in a MarkLogic database. The client requires connecting to a MarkLogic REST API app server and is ideal for applications wishing to build upon the MarkLogic REST API.

The client supports the following core features of the MarkLogic database:

  • Write and read binary, JSON, text, and XML documents.
  • Query data structure trees, marked-up text, and all the hybrids in between those extremes.
  • Project values, tuples, and triples from hierarchical documents and aggregate over them.
  • Patch documents with partial updates.
  • Use Optimistic Locking to detect contention without creating locks on the server.
  • Execute ACID modifications so the change either succeeds or throws an exception.
  • Execute multi-statement transactions so changes to multiple documents succeed or fail together.
  • Call Data Services by means of a Java interface on the client for data functionality implemented by an endpoint on the server.

The client can be used in applications running on Java 8, 11, and 17. If you are using Java 11 or higher and intend to use JAXB, please see the section below for ensuring that the necessary dependencies are available in your application's classpath.

QuickStart

To use the client in your Maven project, include the following in your pom.xml file:

<dependency>
    <groupId>com.marklogic</groupId>
    <artifactId>marklogic-client-api</artifactId>
    <version>6.4.1</version>
</dependency>

To use the client in your Gradle project, include the following in your build.gradle file:

dependencies {
    implementation "com.marklogic:marklogic-client-api:6.4.1"
}

Next, read The Java API in Five Minutes to get started.

Full documentation is available at:

Including JAXB support

If you are using Java 11 or higher (including Java 17) and you wish to use JAXB with the client, you'll need to include JAXB API and implementation dependencies as those are no longer included in Java 11 and higher.

For Maven, include the following in your pom.xml file:

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.1</version>
</dependency>
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.3.2</version>
</dependency>
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-core</artifactId>
    <version>2.3.0.1</version>
</dependency>

For Gradle, include the following in your build.gradle file (this can be included in the same dependencies block as the one that includes the marklogic-client-api dependency):

dependencies {
    implementation "javax.xml.bind:jaxb-api:2.3.1"
    implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
    implementation "org.glassfish.jaxb:jaxb-core:2.3.0.1"
}

You are free to use any implementation of JAXB that you wish, but you need to ensure that you're using a JAXB implementation that corresponds to the javax.xml.bind interfaces. JAXB 3.0 and 4.0 interfaces are packaged under jakarta.xml.bind, and the Java API does not yet depend on those interfaces.

Thus, you are free to include an implementation of JAXB 3.0 or 4.0 in your project for your own use; it will not affect the Java API. A caveat though is if you are trying to use different major versions of the same JAXB implementation library - such as org.glassfish.jaxb:jaxb-runtime - then you will run into an expected dependency conflict between the two versions of the library. This can be worked around by using a different implementation of JAXB 3.0 or JAXB 4.0 - for example:

dependencies {
    // JAXB 2 dependencies required by Java Client
    implementation "javax.xml.bind:jaxb-api:2.3.1"
    implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
    implementation "org.glassfish.jaxb:jaxb-core:2.3.0.1"
    
    // JAXB 4 dependencies required by other application code
    implementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.0"
    implementation "com.sun.xml.bind:jaxb-impl:4.0.1"
}

The client will soon be updated to use the newer jakarta.xml.bind interfaces. Until then, the above approach or one similar to it will allow for both the old and new JAXB interfaces and implementations to exist together in the same classpath.

Support

The MarkLogic Java Client is maintained by MarkLogic Engineering and is made available under the Apache 2.0 license. It is designed for use in production applications with MarkLogic Server. Everyone is encouraged to file bug reports, feature requests, and pull requests through GitHub. This input is critical and will be carefully considered. However, we can’t promise a specific resolution or timeframe for any request. In addition, MarkLogic provides technical support for release tags of the Java Client to licensed customers under the terms outlined in the MarkLogic Technical Support Handbook. Customers with an active maintenance contract can sign up for MarkLogic Technical Support on our support portal.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.