Skip to content

Instantly share code, notes, and snippets.

View gunnarmorling's full-sized avatar
🤓
Streaming data changes, one at a time.

Gunnar Morling gunnarmorling

🤓
Streaming data changes, one at a time.
View GitHub Profile

It's my pleasure to announce the availability of Bean Validation TCK 1.1.0.CR1 and Hibernate Validator 5.0.0.CR1.

You can find the TCK

  • as Maven artifact in the JBoss Maven repository under the coordinates org.hibernate.beanvalidation.tck:beanvalidation-tck-tests:1.1.0.CR1 and
  • as distribution bundle (ZIP or TAR) on SourceForge

Hibernate Validator can be retrieved

Bean Validation 1.1 Feature Spotlight - Expression Language

It has been a couple of weeks since Bean Validation 1.1 has gone final. In the mean time, the Java EE 7 platform spec has been finalized as well, so it's about time to have a closer look at what you can expect from these updates in relation to Bean Validation and its reference implementation, Hibernate Validator 5.

Over the following weeks, we'll dive into the most exciting new features in a series of blog posts, starting today with the usage of expression language in error messages.

Executive summary

Many users relate the Unified Expression Language (EL) only to the UI technologies JSF and JSP. But it doesn't stop there. Actually, EL has matured over time into an independent language with it's own specification. It can be

@gunnarmorling
gunnarmorling / api.java
Last active December 19, 2015 11:38
OGM configuration API experiments
public class Mapping<C> {
public EntityContext<C> entity(Class<?> type) {
return null;
}
public <T> Mapping<C> set(GlobalOption<C, T> option, T value) {
return this;
}
}
public class SamplePropertyContext extends PropertyContextBase {
public SamplePropertyContext force(boolean force) {
Force option = createOption( Force.class );
set( option.value(), force );
return this;
}
public SamplePropertyContext namedQuery(String name, String query) {
NamedQuery option = createOption( NamedQuery.class );
@gunnarmorling
gunnarmorling / 1.java
Last active December 20, 2015 03:28
Options for configuring group conversions via the API (https://hibernate.atlassian.net/browse/HV-642)
ConstraintMapping mapping = config.createConstraintMapping();
mapping.type( GreetingService.class )
.method( "greet", User.class )
.returnValue()
.valid()
.convertGroup( Default.class ).to( User.class )
.convertGroup( Foo.class ).to( Bar.class );
//more "fluent" name?
ConstraintMapping mapping = config.createConstraintMapping();
@gunnarmorling
gunnarmorling / hv-5.1.0.-alpha1.md
Last active December 20, 2015 20:49
# Hibernate Validator 5.1.0.Alpha1 Released

Hibernate Validator 5.1.0.Alpha1 Released

It's my pleasure to announce the first alpha release of Hibernate Validator 5.1. This release brings you several new features based on top of the Bean Validation 1.1 APIs, substantial performance improvements as well as some bug fixes.

As usual, you can obtain this release either as distribution bundle (ZIP or TAR.GZ) from SourceForge or retrieve it using your preferred dependency management tool under the GAV coordinates org.hibernate:hibernate-validator:5.1.0.Alpha1. The binaries have been pushed to the JBoss Maven repository and should soon be synched to Maven Central as well.

What's in it?

The features added in this release are centered around the new APIs and functionality provided by Bean Validation 1.1, such as method validation and expression based message int

Apply annotation-based constraints to your model and check them via a simple to use API.
Take advantage of a close integration with JPA and CDI to automatically validate your constraints
upon persisting your entities or method invocation.
public interface DataStoreSession<D extends DataStoreSession<D, O>, O extends Operation<?, D, O>> {
public void accept(O operation);
}
public interface Operation<T, D extends DataStoreSession<D, O>, O extends Operation<T, D, O>> {
public T perform(D session) throws Exception;
}

Hibernate OGM 4.1.0.Beta1 is out

It's my great pleasure to announce the release of Hibernate OGM 4.1.0.Beta1! This version shines with:

  • support for CouchDB
  • query execution via JPA
  • and much more including a version bump

But wait, hasn't the last released version been 4.0.0.Beta4? That's true indeed, and in case you were wondering, we did not forget to do a final release of the 4.0 line. The reason for the version bump is that Hibernate OGM is now compatible with JPA 2.1 and Hibernate ORM 4.3. To reflect this we thought it'd be a good idea to jump to a new minor version as well.

@Override
public Iterator<Tuple> executeBackendQuery(CustomQuery customQuery, QueryParameters queryParameters, EntityKeyMetadata[] metadatas) {
//e.g. "db.Item.find({ foo : bar })
String query = customQuery.getSQL();
// parse via Parboiled
QueryDescriptor qd = new QueryParser().parse( query );
//qd.collection = "Item"