提交 b1a3cf48 authored 作者: Thomas Mueller's avatar Thomas Mueller

JaQu improvements

上级 71aa57a5
......@@ -43,16 +43,15 @@ A Java Runtime Environment (JRE) version 1.4 or higher is required to run this d
To build the database executables, the following software stack was used.
Newer version or compatible software works too.
</p>
<ul>
<li>Windows XP
</li><li>Sun JDK Version 1.4 and 1.6
</li><li>Eclipse Version 3.3
</li><li>Eclipse Plugins: Subclipse 1.2.4, EclEmma Java Code Coverage 1.3.0, Eclipse Checkstyle Plug-in 4.4.0
</li><li>Mozilla Firefox 3.0
</li><li>OpenOffice 3.0
</li><li>NSIS 2.38 (Nullsoft Scriptable Install System)
</li><li>Maven 2.0.7
</li><li>YourKit Java Profiler
<ul><li>Windows XP
</li><li>Sun JDK Version 1.4 and 1.6
</li><li>Eclipse Version 3.3
</li><li>Eclipse Plugins: Subclipse 1.2.4, EclEmma Java Code Coverage 1.3.0, Eclipse Checkstyle Plug-in 4.4.0
</li><li>Mozilla Firefox 3.0
</li><li>OpenOffice 3.0
</li><li>NSIS 2.38 (Nullsoft Scriptable Install System)
</li><li>Maven 2.0.7
</li><li>YourKit Java Profiler
</li></ul>
<br /><a name="building"></a>
......@@ -150,6 +149,6 @@ If you like to provide patches, please consider the following guidelines to simp
</li><li>Document grammar changes in src/main/org/h2/res/help.csv
</li><li>Provide a change log entry (src/docsrc/html/changelog.html).
</li><li>Submit patches as .patch files (compressed if big). To create a patch, use for example Eclipse Team/Create Patch.
</ul>
</li></ul>
</div></td></tr></table><!-- analytics --></body></html>
......@@ -35,12 +35,21 @@ SELECT * FROM PRODUCTS P
WHERE P.UNITS_IN_STOCK = 0
</pre>
<h2>Advantages</h2>
<h2>Advantages and Differences to other Data Access Tools</h2>
<p>
Unlike to SQL, JaQu can be easily integrated in Java applications. Because JaQu is pure Java,
Unlike SQL, JaQu can be easily integrated in Java applications. Because JaQu is pure Java,
Javadoc and auto-complete are supported. Type checking is performed by the compiler.
JaQu fully protects against SQL injection.
</p>
<p>
JaQu is much smaller than object-relation mapping tools such as Hibernate.
Unlike iBatis and Hibernate, no XML or annotation based configuration is required;
instead the configuration (if required at all) is done in pure Java, in the application itself.
</p>
<p>
JaQu does not require or contain any data caching mechanism. Like JDBC and iBatis,
JaQu provides full control over when and what SQL statements are executed.
</p>
<h3>Why in Java?</h3>
<p>
......
......@@ -128,8 +128,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>The HELP information schema can be directly exposed in the Console
</li><li>Maybe use the 0x1234 notation for binary fields, see MS SQL Server
</li><li>Support Oracle CONNECT BY in some way: http://www.adp-gmbh.ch/ora/sql/connect_by.html, http://philip.greenspun.com/sql/trees.html
</li><li>SQL Server 2005, Oracle: Support COUNT(*) OVER(). See
http://www.orafusion.com/art_anlytc.htm
</li><li>SQL Server 2005, Oracle: Support COUNT(*) OVER(). See http://www.orafusion.com/art_anlytc.htm
</li><li>RANK() and DENSE_RANK(), Partition using OVER()
</li><li>SQL 2003 (http://www.wiscorp.com/sql_2003_standard.zip)
</li><li>http://www.jpackage.org
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -328,7 +328,8 @@ public class SamplesTest extends TestBase {
productCount = count();
}});
assertEquals("[Beverages:2, Condiments:5, Meat/Poultry:1, Produce:1, Seafood:1]",
assertEquals("[Beverages:2, Condiments:5, " +
"Meat/Poultry:1, Produce:1, Seafood:1]",
list.toString());
}
......
......@@ -258,7 +258,8 @@ public class Build extends BuildBase {
}
/**
* Create the file h2jaqu.jar. This only contains the JaQu (Java Query) implementation.
* Create the file h2jaqu.jar. This only contains the JaQu (Java Query)
* implementation.
*/
public void jarJaqu() {
compile(true, false);
......
......@@ -552,4 +552,6 @@ refill analyzers patches popular came growing indication arabic graphic toc
numbering goto outline makensis macro hyperlink dispatch setlocal wend
widows msgbox designer styles families uno soffice orphans stan ucb rem
pdfurl upate pagebreak ren echo atlassian buggy submitted xcopy invention
harbor generics pojo annotations
harbor generics pojo annotations ecl subclipse jmx bean plugins team cha emma
nullsoft annotation cover scriptable guidelines consider batis coding
anlytc art orafusion
......@@ -26,7 +26,8 @@ class Condition<A> implements Token {
public String getString(Query query) {
if (compareType.hasRightExpression()) {
return query.getString(x) + " " + compareType.getString() + " " + query.getString(y);
return query.getString(x) + " " +
compareType.getString() + " " + query.getString(y);
}
return query.getString(x) + " " + compareType.getString();
}
......
......@@ -86,7 +86,9 @@ public class Function implements Token {
}
public static Boolean or(Boolean... x) {
return Db.registerToken(Utils.newObject(Boolean.class), new Function("", (Object[]) x) {
return Db.registerToken(
Utils.newObject(Boolean.class),
new Function("", (Object[]) x) {
public String getString(Query query) {
StringBuilder buff = new StringBuilder();
for (int i = 0; i < x.length; i++) {
......@@ -101,7 +103,9 @@ public class Function implements Token {
}
public static Boolean and(Boolean... x) {
return Db.registerToken(Utils.newObject(Boolean.class), new Function("", (Object[]) x) {
return Db.registerToken(
Utils.newObject(Boolean.class),
new Function("", (Object[]) x) {
public String getString(Query query) {
StringBuilder buff = new StringBuilder();
for (int i = 0; i < x.length; i++) {
......
......@@ -24,32 +24,38 @@ public class QueryCondition<T, A> {
}
public QueryWhere<T> is(A y) {
query.addConditionToken(new Condition<A>(query, x, y, CompareType.EQUAL));
query.addConditionToken(
new Condition<A>(query, x, y, CompareType.EQUAL));
return new QueryWhere<T>(query);
}
public QueryWhere<T> bigger(A y) {
query.addConditionToken(new Condition<A>(query, x, y, CompareType.BIGGER));
query.addConditionToken(
new Condition<A>(query, x, y, CompareType.BIGGER));
return new QueryWhere<T>(query);
}
public QueryWhere<T> biggerEqual(A y) {
query.addConditionToken(new Condition<A>(query, x, y, CompareType.BIGGER_EQUAL));
query.addConditionToken(
new Condition<A>(query, x, y, CompareType.BIGGER_EQUAL));
return new QueryWhere<T>(query);
}
public QueryWhere<T> smaller(A y) {
query.addConditionToken(new Condition<A>(query, x, y, CompareType.SMALLER));
query.addConditionToken(
new Condition<A>(query, x, y, CompareType.SMALLER));
return new QueryWhere<T>(query);
}
public QueryWhere<T> smallerEqual(A y) {
query.addConditionToken(new Condition<A>(query, x, y, CompareType.SMALLER_EQUAL));
query.addConditionToken(
new Condition<A>(query, x, y, CompareType.SMALLER_EQUAL));
return new QueryWhere<T>(query);
}
public QueryWhere<T> like(A pattern) {
query.addConditionToken(new Condition<A>(query, x, pattern, CompareType.LIKE));
query.addConditionToken(
new Condition<A>(query, x, pattern, CompareType.LIKE));
return new QueryWhere<T>(query);
}
......
......@@ -13,6 +13,7 @@ import org.h2.jaqu.util.Utils;
*
* @param <A> the incomplete condition data type
*/
//## Java 1.5 begin ##
public class TestCondition<A> {
private A x;
......@@ -76,3 +77,4 @@ public class TestCondition<A> {
}
}
//## Java 1.5 end ##
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论