-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
143 changed files
with
6,845 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
documentation/src/main/asciidoc/entity-view/manual/en_US/12_deltaspike_data.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
[[deltaspike-data-integration]] | ||
== DeltaSpike Data integration | ||
|
||
{projectname} provides an integration with https://deltaspike.apache.org/documentation/data.html[DeltaSpike Data] to create entity view based repositories. | ||
|
||
[[deltaspike-data-setup]] | ||
=== Setup | ||
|
||
To setup the project for DeltaSpike Data you have to add the entity view and CDI integration dependencies as described | ||
in the <<getting-started-setup, getting started>> section along with the integration dependencies for your JPA provider | ||
as described in the link:{core_doc}#maven-setup[core module setup section]. | ||
|
||
In addition, the following Maven dependencies are required: | ||
|
||
[source,xml] | ||
---- | ||
<dependency> | ||
<groupId>com.blazebit</groupId> | ||
<artifactId>blaze-persistence-integration-deltaspike-data-api</artifactId> | ||
<version>${blaze-persistence.version}</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.blazebit</groupId> | ||
<artifactId>blaze-persistence-integration-deltaspike-data-impl</artifactId> | ||
<version>${blaze-persistence.version}</version> | ||
<scope>runtime</scope> | ||
</dependency> | ||
---- | ||
|
||
You also need to make beans available for `CriteriaBuilderFactory` and `EntityViewManager` as laid out in the | ||
<<anchor-environments-cdi,CDI environment>> section. | ||
|
||
[[deltaspike-data-features]] | ||
=== Features | ||
|
||
To mark a class or an interface as repository, use the DeltaSpike `org.apache.deltaspike.data.api.Repository` annotation. | ||
|
||
[source,java] | ||
---- | ||
@Repository(forEntity = Person.class) | ||
public interface PersonViewRepository { | ||
PersonView findAnyByName(String name); | ||
} | ||
---- | ||
|
||
The integration provides the following base interfaces that you may optionally extend to define entity view repositories: | ||
|
||
* `com.balzebit.persistence.impl.deltaspike.data.api.EntityViewRepository` provides simple base methods. | ||
* `com.balzebit.persistence.impl.deltaspike.data.api.FullEntityViewRepository` adds JPA criteria support to the `com.balzebit.persistence.impl.deltaspike.data.api.EntityViewRepository` interface. | ||
|
||
[source,java] | ||
---- | ||
@Repository | ||
public abstract class PersonViewRepository extends FullEntityViewRepository<Person, PersonView, String> { | ||
public abstract PersonView findAnyByName(String name); | ||
public List<PersonView> getPersonsByComplexCondition() { | ||
return criteria().or( | ||
criteria().gt(Person_.position, 3), | ||
criteria().likeIgnoreCase(Person_.name, "john%") | ||
).select(PersonView.class).orderAsc(Person_.id).getResultList(); | ||
} | ||
} | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>blaze-persistence-integration-deltaspike-data</artifactId> | ||
<groupId>com.blazebit</groupId> | ||
<version>1.2.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>blaze-persistence-integration-deltaspike-data-api</artifactId> | ||
|
||
<name>Blazebit Persistence Integration DeltaSpike Data API</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>javax</groupId> | ||
<artifactId>javaee-api</artifactId> | ||
<version>7.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.deltaspike.modules</groupId> | ||
<artifactId>deltaspike-data-module-api</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>blaze-persistence-entity-view-api</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Oops, something went wrong.