JDO 3.2 JDOQLTypedQuery : improvements relative to DN extension

Now that JDO 3.2 standardises the “typed query” mechanism that we prototyped in DataNucleus v3.x and v4.0/v4.1 it is worth mentioning the additions to the API that are present in the JDO 3.2 variant.

StringExpression

This has gained the following methods to providing JDOQL “matches” operation capability

BooleanExpression matches(StringExpression expr);
BooleanExpression matches(String str);

 

NumericExpression

The following methods are added, for bitwise operations support

NumericExpression bAnd(NumericExpression bitExpr);
NumericExpression bOr(NumericExpression bitExpr);
NumericExpression bXor(NumericExpression bitExpr);

In addition it also gains these methods to match the equivalent JDOQL string based operators (-, ~)

NumericExpression neg();
NumericExpression com();

 

CharacterExpression

This also gains the JDOQL string based operators (-, ~)

NumericExpression neg();
NumericExpression com();

 

BooleanExpression

This gains the JDOQL string based operator (-)

BooleanExpression neg();

Java 8

In addition to the above you can now also make use of Java8 Time types in JDOQLTypedQuery, whereas this was not possible in the previous DataNucleus extension.

 

API

The JDOQLTypedQuery class has some slight changes to make it more consistent with the JDOQL standard API.

  • Added method result(…) rather than specifying result clauses in the execute call.
  • Changed addExtension/setExtensions methods to extension(…)/extensions(…).
  • Added unmodifiable, serializeRead, datastoreReadTimeout, datastoreWriteTimeout, ignoreCache, saveAsNamedQuery.
Advertisements
This entry was posted in JDO, JDOQL, LINQ, Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s