Skip to content

Commit

Permalink
#177: modularized and improved
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille committed Apr 10, 2016
1 parent 8ee365d commit 75c78a7
Show file tree
Hide file tree
Showing 41 changed files with 540 additions and 100 deletions.
12 changes: 12 additions & 0 deletions mmm-util-query/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Mature Modular Meta-framework (mmm)

![logo](https://raw.github.com/m-m-m/mmm/master/src/site/resources/images/logo.png)

**Welcome to the wonderful world of [mmm](http://m-m-m.sourceforge.net/index.html)!**

## mmm-util-property

This module is part of the [mmm-util project](../README.md) and brings extended property and bean support including
* [Properties](http://m-m-m.github.io/maven/apidocs/net/sf/mmm/util/property/api/package-summary.html#package.description) extending JavaFx properties with type reflection and validation support.
* [Bean](http://m-m-m.github.io/maven/apidocs/net/sf/mmm/util/bean/api/package-summary.html#package.description) to implement beans as interface without writing any boiler-plate code.
* and much more...
52 changes: 52 additions & 0 deletions mmm-util-query/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.sf.m-m-m</groupId>
<artifactId>mmm-util-modules</artifactId>
<version>dev-SNAPSHOT</version>
<relativePath>../mmm-util-modules/pom.xml</relativePath>
</parent>
<artifactId>mmm-util-query</artifactId>
<version>${net.sf.mmm.util.version}</version>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>This project allows to build queries with a fluent and type-safe API.</description>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mmm-util-property</artifactId>
<version>${net.sf.mmm.util.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mmm-util-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query;
package net.sf.mmm.util.query.api;

import net.sf.mmm.util.property.api.query.feature.FeatureLimit;
import net.sf.mmm.util.property.api.query.feature.FeatureWhere;
import net.sf.mmm.util.query.api.feature.FeatureLimit;
import net.sf.mmm.util.query.api.feature.FeatureWhere;

/**
* Extends {@link Statement} for {@code UPDATE} statements.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query;
package net.sf.mmm.util.query.api;

/**
* Extends {@link Statement} for {@code INSERT} statements.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query;
package net.sf.mmm.util.query.api;

import net.sf.mmm.util.property.api.query.feature.FeatureModify;
import net.sf.mmm.util.query.api.feature.FeatureModify;

/**
* Extends {@link Statement} for modifying data.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query;
package net.sf.mmm.util.query.api;

import net.sf.mmm.util.property.api.query.feature.FeatureFetch;
import net.sf.mmm.util.property.api.query.feature.FeatureGroupBy;
import net.sf.mmm.util.property.api.query.feature.FeatureOrderBy;
import net.sf.mmm.util.property.api.query.feature.FeaturePaging;
import net.sf.mmm.util.property.api.query.feature.FeatureWhere;
import net.sf.mmm.util.query.api.feature.FeatureFetch;
import net.sf.mmm.util.query.api.feature.FeatureGroupBy;
import net.sf.mmm.util.query.api.feature.FeatureOrderBy;
import net.sf.mmm.util.query.api.feature.FeaturePaging;
import net.sf.mmm.util.query.api.feature.FeatureWhere;

/**
* Extends {@link Statement} for regular {@code SELECT} statements to retrieve results (unlike {@link InsertStatement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query;
package net.sf.mmm.util.query.api;

import java.util.List;

import net.sf.mmm.util.property.api.expression.Expression;
import net.sf.mmm.util.property.api.path.PropertyPath;
import net.sf.mmm.util.property.base.query.SqlDialect;
import net.sf.mmm.util.query.base.SqlDialect;

/**
* This interface allows to build and execute type-safe query statements using a fluent API based on
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query;
package net.sf.mmm.util.query.api;

import net.sf.mmm.util.property.api.query.feature.FeatureSet;
import net.sf.mmm.util.query.api.feature.FeatureSet;

/**
* Extends {@link Statement} for storing data.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query;
package net.sf.mmm.util.query.api;

import net.sf.mmm.util.property.api.query.feature.FeatureLimit;
import net.sf.mmm.util.property.api.query.feature.FeatureWhere;
import net.sf.mmm.util.query.api.feature.FeatureLimit;
import net.sf.mmm.util.query.api.feature.FeatureWhere;

/**
* Extends {@link Statement} for {@code UPDATE} statements.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query.feature;
package net.sf.mmm.util.query.api.feature;

import java.util.List;

/**
* A {@link FeatureFetch} is for a regular query {@link net.sf.mmm.util.property.api.query.Statement} to fetch and
* A {@link FeatureFetch} is for a regular query {@link net.sf.mmm.util.query.api.Statement} to fetch and
* retrieve results.
*
* @see net.sf.mmm.util.property.api.query.SelectStatement
* @see net.sf.mmm.util.query.api.SelectStatement
*
* @param <E> the generic type of the entity to fetch.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query.feature;
package net.sf.mmm.util.query.api.feature;

import net.sf.mmm.util.property.api.path.PropertyPath;

/**
* This is the abstract interface for a query {@link net.sf.mmm.util.property.api.query.Statement} allowing a
* This is the abstract interface for a query {@link net.sf.mmm.util.query.api.Statement} allowing a
* {@link #groupBy(PropertyPath) GROUP BY clause}.
*
* @param <SELF> the generic type of this query itself (this) for fluent API calls.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query.feature;
package net.sf.mmm.util.query.api.feature;

import net.sf.mmm.util.property.api.expression.Expression;

/**
* This is the abstract interface for a query {@link net.sf.mmm.util.property.api.query.Statement} allowing a
* This is the abstract interface for a query {@link net.sf.mmm.util.query.api.Statement} allowing a
* {@link #having(Expression...) HAVING clause}.
*
* @param <SELF> the generic type of this query itself (this) for fluent API calls.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query.feature;
package net.sf.mmm.util.query.api.feature;

/**
* This is the abstract interface for a query {@link net.sf.mmm.util.property.api.query.Statement} with support for
* This is the abstract interface for a query {@link net.sf.mmm.util.query.api.Statement} with support for
* {@link #limit(long)}.
*
* @param <SELF> the generic type of this query itself (this) for fluent API calls.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query.feature;
package net.sf.mmm.util.query.api.feature;

import net.sf.mmm.util.property.api.query.Statement;
import net.sf.mmm.util.query.api.Statement;

/**
* Extends {@link Statement} for a query {@link net.sf.mmm.util.property.api.query.Statement} that modifies data.
* Extends {@link Statement} for a query {@link net.sf.mmm.util.query.api.Statement} that modifies data.
*
* @see net.sf.mmm.util.property.api.query.ModifyStatement
* @see net.sf.mmm.util.query.api.ModifyStatement
*
* @author hohwille
* @since 8.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query.feature;
package net.sf.mmm.util.query.api.feature;

import net.sf.mmm.util.lang.api.SortOrder;
import net.sf.mmm.util.property.api.path.PropertyPath;

/**
* This is the abstract interface for a query {@link net.sf.mmm.util.property.api.query.Statement} allowing an
* This is the abstract interface for a query {@link net.sf.mmm.util.query.api.Statement} allowing an
* {@link #orderBy(PropertyPath, SortOrder) ORDER BY clause}.
*
* @param <SELF> the generic type of this query itself (this) for fluent API calls.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query.feature;
package net.sf.mmm.util.query.api.feature;

/**
* This is the abstract interface for a query {@link net.sf.mmm.util.property.api.query.Statement} with paging support
* This is the abstract interface for a query {@link net.sf.mmm.util.query.api.Statement} with paging support
* via {@link #limit(long)} and {@link #offset(long)}.
*
* @param <SELF> the generic type of this query itself (this) for fluent API calls.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query.feature;
package net.sf.mmm.util.query.api.feature;

import net.sf.mmm.util.property.api.path.PropertyPath;

/**
* This is the abstract interface for a query {@link net.sf.mmm.util.property.api.query.Statement} allowing a
* This is the abstract interface for a query {@link net.sf.mmm.util.query.api.Statement} allowing a
* {@link #set(PropertyPath, Object) SET clause}.
*
* @param <SELF> the generic type of this query itself (this) for fluent API calls.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.query.api.feature;

import net.sf.mmm.util.property.api.path.PropertyPath;

/**
* This is the abstract interface for a query {@link net.sf.mmm.util.query.api.Statement} allowing a
* {@link #value(PropertyPath, Object) VALUES clause}. For each invocation of {@link #value(PropertyPath, Object)
* value(pI, vI)} a value binding is added so in the end the resulting SQL fragment will be:
*
* <pre>
* (p1, p2, ..., pN) VALUES (v1, v2, ..., vN)
* </pre>
*
* @param <SELF> the generic type of this query itself (this) for fluent API calls.
*
* @author hohwille
* @since 8.0.0
*/
public abstract interface FeatureValues<SELF extends FeatureValues<SELF>> extends StatementFeature {

/**
* Adds a value binding setting the given {@link PropertyPath} to the given {@code value}.
*
* @param <V> the generic type of the {@code value}.
* @param path the {@link PropertyPath} for the value to assign that will be added to the bracket before the
* {@ocde VALUES} keyword.
* @param value the literal value to assign that will be added to the bracket after the {@ocde VALUES} keyword.
* @return this query instance for fluent API calls.
*/
<V> SELF value(PropertyPath<V> path, V value);

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query.feature;
package net.sf.mmm.util.query.api.feature;

import net.sf.mmm.util.property.api.expression.Expression;

/**
* This is the abstract interface for a query {@link net.sf.mmm.util.property.api.query.Statement} allowing a
* This is the abstract interface for a query {@link net.sf.mmm.util.query.api.Statement} allowing a
* {@link #where(Expression...) WHERE clause}.
*
* @param <SELF> the generic type of this query itself (this) for fluent API calls.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query.feature;
package net.sf.mmm.util.query.api.feature;

/**
* Marker interface for a feature on a {@link net.sf.mmm.util.property.api.query.Statement}.
* Marker interface for a feature on a {@link net.sf.mmm.util.query.api.Statement}.
*
* @author hohwille
* @since 8.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.api.query;
package net.sf.mmm.util.query.api.jpql;

import net.sf.mmm.util.property.api.query.feature.FeatureHaving;
import net.sf.mmm.util.query.api.SelectStatement;
import net.sf.mmm.util.query.api.feature.FeatureHaving;

/**
* Extends a regular {@link SelectStatement} with advanced features like
* {@link #having(net.sf.mmm.util.property.api.expression.Expression...) HAVING clause}.
*
* @param <E> the generic type of the queried object (typically a {@link net.sf.mmm.util.bean.api.Bean}).
* @param <SELF> the generic type of this query itself (this) for fluent API calls.
*
* @author hohwille
* @since 8.0.0
*/
public interface JpqlSelectStatement<E, SELF extends JpqlSelectStatement<E, SELF>>
extends SelectStatement<E, SELF>, FeatureHaving<SELF> {
public interface JpqlSelectStatement<E>
extends SelectStatement<E, JpqlSelectStatement<E>>, FeatureHaving<JpqlSelectStatement<E>> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.query.api.orientdb;

import net.sf.mmm.util.query.api.SelectStatement;
import net.sf.mmm.util.query.api.feature.FeatureHaving;

/**
* Extends a regular {@link SelectStatement} with advanced features like
* {@link #having(net.sf.mmm.util.property.api.expression.Expression...) HAVING clause}.
*
* @param <E> the generic type of the queried object (typically a {@link net.sf.mmm.util.bean.api.Bean}).
*
* @author hohwille
* @since 8.0.0
*/
public interface OrientDbSelectStatement<E>
extends SelectStatement<E, OrientDbSelectStatement<E>>, FeatureHaving<OrientDbSelectStatement<E>> {

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.property.base.query;
package net.sf.mmm.util.query.base;

import net.sf.mmm.util.property.api.expression.Expression;
import net.sf.mmm.util.property.api.query.DeleteStatement;
import net.sf.mmm.util.query.api.DeleteStatement;

/**
* This is the abstract base-implementation of {@link DeleteStatement}.
Expand Down
Loading

0 comments on commit 75c78a7

Please sign in to comment.