jpa-apt

Reads the JPA (Java Persistence API) annotations of all entities and creates a metamodel from them so that it can be processed by subsequent libraries, e. g. an EntityManager or a JPA provider.

License

License

Categories

Categories

Net
GroupId

GroupId

net.dankito.jpa.annotationreader
ArtifactId

ArtifactId

jpa-apt
Last Version

Last Version

1.0.0-alpha5
Release Date

Release Date

Type

Type

jar
Description

Description

jpa-apt
Reads the JPA (Java Persistence API) annotations of all entities and creates a metamodel from them so that it can be processed by subsequent libraries, e. g. an EntityManager or a JPA provider.
Project URL

Project URL

https://github.com/dankito/jpa-apt
Source Code Management

Source Code Management

https://github.com/dankito/jpa-apt

Download jpa-apt

How to add to project

<!-- https://jarcasting.com/artifacts/net.dankito.jpa.annotationreader/jpa-apt/ -->
<dependency>
    <groupId>net.dankito.jpa.annotationreader</groupId>
    <artifactId>jpa-apt</artifactId>
    <version>1.0.0-alpha5</version>
</dependency>
// https://jarcasting.com/artifacts/net.dankito.jpa.annotationreader/jpa-apt/
implementation 'net.dankito.jpa.annotationreader:jpa-apt:1.0.0-alpha5'
// https://jarcasting.com/artifacts/net.dankito.jpa.annotationreader/jpa-apt/
implementation ("net.dankito.jpa.annotationreader:jpa-apt:1.0.0-alpha5")
'net.dankito.jpa.annotationreader:jpa-apt:jar:1.0.0-alpha5'
<dependency org="net.dankito.jpa.annotationreader" name="jpa-apt" rev="1.0.0-alpha5">
  <artifact name="jpa-apt" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.dankito.jpa.annotationreader', module='jpa-apt', version='1.0.0-alpha5')
)
libraryDependencies += "net.dankito.jpa.annotationreader" % "jpa-apt" % "1.0.0-alpha5"
[net.dankito.jpa.annotationreader/jpa-apt "1.0.0-alpha5"]

Dependencies

compile (2)

Group / Artifact Type Version
net.dankito.jpa.annotationreader : api jar 1.0.0-alpha5
com.squareup : javapoet jar 1.9.0

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

jpa-apt

If you need anyhow the JPA entity configuration, jpa-apt reads it for you.

It is an Annotation Processor for the APT build step so the JPA configuration gets read at build time and there's no costly annotation reading with reflection at application start up.

Setup

Gradle:

// so that generated meta model is visible from code
sourceSets {
    main.java.srcDirs += 'build/generated/'
}

dependencies {
  compile 'net.dankito.jpa.annotationreader:jpa-apt:1.0-alpha'
  kapt 'net.dankito.jpa.annotationreader:jpa-apt:1.0-alpha'
}

Maven:

<dependency>
   <groupId>net.dankito.jpa.annotationreader</groupId>
   <artifactId>jpa-apt</artifactId>
   <version>1.0-alpha</version>
</dependency>

Usage

private fun loadGeneratedModel(): JPAEntityConfiguration {
        val generatedConfigs = net.dankito.jpa.apt.generated.GeneratedEntityConfigs()

        val generatedEntityConfigs = generatedConfigs.getGeneratedEntityConfigs()
    }

License

Copyright 2017 dankito

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
1.0.0-alpha5
1.0.0-alpha4
1.0-alpha3
1.0-alpha2
1.0-alpha