Mirror of Apache Cayenne
Java Other
Latest commit 6b80409 Feb 15, 2018
Permalink
Failed to load latest commit information.
assembly New version of JApp plugin with new launchers for Mac and Windows Jan 29, 2018
build-tools Add suppressions to checkstyle Feb 6, 2018
cayenne-ant CAY-2395 cdbimport: add option to create project file Jan 23, 2018
cayenne-cache-invalidation Code-checkers Feb 2, 2018
cayenne-cgen Add generics to value holders Feb 7, 2018
cayenne-client-jetty Code-coverage plugin Jan 26, 2018
cayenne-client Cleanup Feb 2, 2018
cayenne-commitlog Code-checkers Feb 2, 2018
cayenne-crypto Clean up client superclass template Feb 7, 2018
cayenne-dbcp2 Code-coverage plugin Jan 26, 2018
cayenne-dbsync Code cleanup Feb 8, 2018
cayenne-di Code check and code-coverage and code-quality options Jan 26, 2018
cayenne-gradle-plugin CAY-2334 cgen: option to force run from maven/gradle Feb 2, 2018
cayenne-jcache Code-checkers Feb 2, 2018
cayenne-jgroups CAY-2403 Feb 2, 2018
cayenne-jms CAY-2403 Feb 2, 2018
cayenne-joda Code-coverage plugin Jan 26, 2018
cayenne-lifecycle Code check and code-coverage and code-quality options Jan 26, 2018
cayenne-osgi Code check and code-coverage and code-quality options Jan 26, 2018
cayenne-project-compatibility Code check and code-coverage and code-quality options Jan 26, 2018
cayenne-project Minor code cleanup Feb 9, 2018
cayenne-protostuff Add generics to value holders Feb 7, 2018
cayenne-rop-server Add generics to value holders Feb 7, 2018
cayenne-server Cleanup Feb 15, 2018
cayenne-velocity Code-coverage plugin Jan 26, 2018
cayenne-web Code-coverage plugin Jan 26, 2018
cayenne-xmpp CAY-2403 Feb 2, 2018
docs Update ROP tutorial screenshot Feb 13, 2018
maven-plugins CAY-2404 Feb 5, 2018
modeler Modeler: always force run code generator Feb 8, 2018
tutorials Upgrade tutorials Feb 13, 2018
.gitignore Update dependencies versions. Jun 7, 2017
.travis.yml CAY-2393 Add sqlserver-docker profile Jan 17, 2018
KEYS Move RELEASE-NOTES, UPGRADE and KEYS files to top level Jan 23, 2018
README.md Update readme Feb 2, 2018
RELEASE-NOTES.txt CAY-2406 Add prefetch-related API to SQLSelect Feb 14, 2018
UPGRADE.txt Move RELEASE-NOTES, UPGRADE and KEYS files to top level Jan 23, 2018
pom.xml Add suppressions to checkstyle Feb 6, 2018
rat.sh Add missing licenses and add RAT ignore for **/build dirs. Jun 2, 2017

README.md

Apache Cayenne

Maven Central Build Status

Apache Cayenne Logo

Apache Cayenne is an open source persistence framework licensed under the Apache License, providing object-relational mapping (ORM) and remoting services.

Quick Start

Modeler GUI application

To create Cayenne project you will need Cayenne Modeler. You can download it from https://cayenne.apache.org/download/

Modeler

See tutorial https://cayenne.apache.org/docs/4.0/getting-started-guide/

Include Cayenne into project

Maven
<dependencies>
    <dependency>
        <groupId>org.apache.cayenne</groupId>
        <artifactId>cayenne-server</artifactId>
        <version>4.0.B2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cayenne</groupId>
        <artifactId>cayenne-java8</artifactId>
        <version>4.0.B2</version>
    </dependency>
</dependencies>
Gradle
compile group: 'org.apache.cayenne', name: 'cayenne-server', version: '4.0.B2'
compile group: 'org.apache.cayenne', name: 'cayenne-java8', version: '4.0.B2'

Create Cayenne Runtime

ServerRuntime cayenneRuntime = ServerRuntime.builder()
    .addConfig("cayenne-project.xml")
    .build();

Create New Objects

ObjectContext context = cayenneRuntime.newContext();

Artist picasso = context.newObject(Artist.class);
picasso.setName("Pablo Picasso");
picasso.setDateOfBirth(LocalDate.of(1881, 10, 25));

Painting girl = context.newObject(Painting.class);
girl.setName("Girl Reading at a Table");
girl.setArtist(picasso);

context.commitChanges();

Select Objects

// Single object select with order
Artist artist = ObjectSelect.query(Artist.class)
        .orderBy(Artist.NAME.asc())
        .selectFirst(context);

// Select with join
List<Painting> paintings = ObjectSelect.query(Painting.class)
        .where(Painting.ARTIST.dot(Artist.DATE_OF_BIRTH).lt(LocalDate.of(1900, 1, 1)))
        .select(context);

// Select count
long count = ObjectSelect.query(Painting.class)
        .where(Painting.ESTIMATED_PRICE.gt(10000))
        .selectCount(context);

Documentation

Getting Started

https://cayenne.apache.org/docs/4.0/getting-started-guide/

Full documentation

https://cayenne.apache.org/docs/4.0/cayenne-guide/

JavaDoc

https://cayenne.apache.org/docs/4.0/api/

About

With a wealth of unique and powerful features, Cayenne can address a wide range of persistence needs. Cayenne seamlessly binds one or more database schemas directly to Java objects, managing atomic commit and rollbacks, SQL generation, joins, sequences, and more. With Cayenne's Remote Object Persistence, those Java objects can even be persisted out to clients via Web Services.

Cayenne is designed to be easy to use, without sacrificing flexibility or design. To that end, Cayenne supports database reverse engineering and generation, as well as a Velocity-based class generation engine. All of these functions can be controlled directly through the CayenneModeler, a fully functional GUI tool. No cryptic XML or annotation based configuration is required! An entire database schema can be mapped directly to Java objects within minutes, all from the comfort of the GUI-based CayenneModeler.

Cayenne supports numerous other features, including caching, a complete object query syntax, relationship pre-fetching, on-demand object and relationship faulting, object inheritance, database auto-detection, and generic persisted objects. Most importantly, Cayenne can scale up or down to virtually any project size. With a mature, 100% open source framework, an energetic user community, and a track record of solid performance in high-volume environments, Cayenne is an exceptional choice for persistence services.

License

Cayenne is available as free and open source under the Apache License, Version 2.0.

Collaboration