Skip to content

Instantly share code, notes, and snippets.

CouchDB dialect, enhanced query support and more: 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:

  • a new dialect for CouchDB,
  • support for query execution via JPA,
  • a new option API,
  • 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.

@Embeddable
class Address {
...
@Convert(...) private String city;
}
@Entity
@Convert(attributeName="homeAddress.city", disableConversion=true)
class Person {
arnaud@petit-robot-1$ git dependency:go-offline
git: 'dependency:go-offline' is not a git command.
Allo, non mais allo quoi! T'utilises git et tu mets le mode offline?
Allô. Allô! Je ne sais pas, vous me recevez? T'utilises git et tu mets le mode offline?
C'est comme si j'te dis: t'es développeur et t'as des cheveux!
arnaud@petit-robot-1$
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();

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, so it's about time to have a closer look at what you can expect from this update to the Bean Validation spec and its reference implementation, Hibernate Validator 5. Over the following weeks, we'll discuss the most exciting new features in a series of blog posts, starting today with the usage of expression language in error messages.

One of the lesser known facts about Java EE is that the Unified Expression Language (UEL) can not only be used in JSF or JSP pages, but actually in any application layer. Bean Validation leverages this to support the creation of constraint violation messages in a dynamic manner.

As an example, let's take a look at th

@emmanuelbernard
emmanuelbernard / BridgeOptions.java
Last active December 19, 2015 06:08
This model will encourage people to use BaseFieldBridgeOptions as the base implementation. This will be future proof as we can offer a default sensible implementation.
public interface FieldBridge { //could be an additional interface if that's better
[...]
FieldBridgeOptions getOptions();
}
interface FieldBridgeOptions {
/**
* List of properties read by the class bridge
*/
String[] getPropertiesRead();
/* vim: set softtabstop=4 shiftwidth=4 expandtab
* vim: set filetype=js
*/
// Keyword query
{
"class": "Show",
"firstResult": 0,
"maxResults": 20,
12:11:24,780 INFO [org.jboss.modules] JBoss Modules version 1.1.3.GA-redhat-1
12:11:26,162 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA-redhat-2
12:11:26,435 INFO [org.jboss.as] JBAS015899: JBoss EAP 6.0.1.GA (AS 7.1.3.Final-redhat-4) starting
12:11:31,214 INFO [org.jboss.as.server.deployment.scanner] JBAS015003: Found ticket-monster-TRUNK.war in deployment directory. To trigger deployment create a file called ticket-monster-TRUNK.war.dodeploy
12:11:31,363 INFO [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
12:11:31,363 INFO [org.xnio] XNIO Version 3.0.7.GA-redhat-1
12:11:31,470 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.7.GA-redhat-1
12:11:31,558 INFO [org.jboss.remoting] JBoss Remoting version 3.2.14.GA-redhat-1
12:11:31,710 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
12:11:31,742 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
@emmanuelbernard
emmanuelbernard / beep.pl
Last active December 17, 2015 06:58 — forked from anonymous/beep.pl
Do not look for (and expand) message and nick when reacting to DCC sig
#
# Copyright (C) 2006-2012 Sebastien Helleu <[email protected]>
# Copyright (C) 2011 Nils Görs <[email protected]>
# Copyright (C) 2011 ArZa <[email protected]>
# Copyright (C) 2013 Emmanuel Bernard <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
private class Indexer {
public void consumes(Iterator<Tuple> entityTuples) {
while (Tuple tuple = entityTuples.next() != null) {
Entry entry = convertToEntry(tuple);
pushToExecutorQueue(entry);
}
//pushToExecutorQueue, execute method
public execute() {