Skip to content
Permalink
Browse files
Update README and tweak project to be more portable.
  • Loading branch information
stariy95 committed Sep 11, 2020
1 parent c47c38f commit 17084ca55608bb89a3169612e8935e086748b058
Showing 4 changed files with 64 additions and 3 deletions.
@@ -1 +1,34 @@
== Cayenne Example
## Cayenne 4.2 JDBC ``Type.OTHER`` support demo.

This example shows support for DB specific types that are not part of the JDBC spec.
Apache Cayenne supports Json and Geo types that are available in many modern RDBMS.

The demo uses ``Wkt`` and ``Json`` types,
later additionally wrapped into custom value type ``ObjectNode`` provided by the Jackson library.

### Usage

Start PostGIS DB:

```shell script
docker run --name cayenne-postgis -p 5432:5432 -e POSTGRES_PASSWORD=cayenne -e POSTGRES_USER=cayenne -e POSTGRES_DB=cayenne-postgis -d postgis/postgis
```

Build:

```shell script
mvn package
```

Run:

```shell script
java -jar target/cayenne-jdbc-type-other-1.0-SNAPSHOT.jar -j
java -jar target/cayenne-jdbc-type-other-1.0-SNAPSHOT.jar -g
```

See Cayenne project:

```shell script
mvn cayenne-modeler:run
```
@@ -23,6 +23,7 @@

<compiler.plugin.version>3.8.1</compiler.plugin.version>
<jar.plugin.version>3.2.0</jar.plugin.version>
<shade.plugin.version>3.2.1</shade.plugin.version>
<surefire.plugin.version>2.22.2</surefire.plugin.version>
<failsafe.plugin.version>2.22.2</failsafe.plugin.version>
</properties>
@@ -98,8 +99,35 @@
<groupId>org.apache.cayenne.plugins</groupId>
<artifactId>cayenne-modeler-maven-plugin</artifactId>
<version>${cayenne.version}</version>
<configuration>
<modelFile>${project.basedir}/src/main/resources/cayenne-demo.xml</modelFile>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${shade.plugin.version}</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${main.class}</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
@@ -14,7 +14,7 @@ public class Application extends BaseBQModule implements BQModuleProvider {

public static void main(String[] args) {
Bootique.app(args)
.args("--config=classpath:config.yml", "-g")
.args("--config=classpath:config.yml")
.module(b -> BQCoreModule.extend(b)
.addCommand(GeoTestCommand.class)
.addCommand(JsonTestCommand.class)
@@ -10,7 +10,7 @@ jdbc:

cayenne:
datasource: geo
createSchema: false
createSchema: true
maps:
- location: classpath:demo.map.xml
name: map1

0 comments on commit 17084ca

Please sign in to comment.