Skip to content

Instantly share code, notes, and snippets.

@DavideD
DavideD / git_lg.sh
Created August 6, 2012 21:18
Better git log
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset%cn' --abbrev-commit"
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset%C(yellow)%d%Creset %s %Cgreen(%cr, %cn) %C(bold blue)%Creset' --abbrev-commit"
@DavideD
DavideD / gist:3742603
Created September 18, 2012 11:10
Git common options for repository
#The receive.denyNonFastforwards flag makes sure that merges can't happen when you push to the repo. You have to do the merges on your local machine, and then push the result.
git config receive.denyNonFastforwards true
@DavideD
DavideD / gist:4008816
Created November 3, 2012 21:08
ImageMagick PDF conversion
convert -verbose -density 150 -trim original.pdf -quality 100 -sharpen 0x1.0 converted.bmp
convert a.png b.png -compress jpeg -resize 1240x1753 \
-units PixelsPerInch -density 150x150 \
-repage a4 multipage.pdf
@DavideD
DavideD / gist:6131417
Created August 1, 2013 13:39
fail safe plugin
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
@DavideD
DavideD / pom-changes
Created May 30, 2014 16:45
Changes to the pom
<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>
<groupId>devday</groupId>
<artifactId>demo</artifactId>
<version>1.0</version>
<build>
<resources>
<resource>

Hibernate OGM 4.1.0.Beta4 is out, bringing MongoDB improved native query support

This release improve the existing support to MongoDB native queries. In Neo4j, it fixes a bug related to the way we store embedded collection (OGM-49) and reduce the amount of relationships created.

As always, you can either download a release bundle from SourceForge or retrieve the JARs from the JBoss Nexus repository server using Maven, Gradle etc. The GAV coordinates are:

_org.hibernate.ogm:hibernate-ogm-core:4.1.0.Beta4_ for the OGM engine and
_org.hibernate.ogm:hibernate-ogm-<datastore>:4.1.0.Beta4_, depending on the backend you want to use.

Support for MongoDB CLI syntax

@DavideD
DavideD / gitconfig
Created February 9, 2018 17:05
My gitconfig
[user]
name = Davide D'Alto\n\n
email = davide@hibernate.org
[color]
ui = true
[rerere]
autoupdate = false
enabled = false
[receive]
denyNonFastForwoard = 1
// tx Begin
EntityManager em = ...
PurchasedOrder order = em.find( PurchaseOrder.class, "5ab88323191bb91e78f9e33d" );
order.setTota( total );
order.purchaseOrderNo( orderNo );
// tx Commit
/*
* Decompiled with CFR 0.148.
*
* Could not load the following classes:
* javax.persistence.Entity
* javax.persistence.Id
* javax.persistence.Transient
* org.hibernate.bytecode.enhance.internal.tracker.DirtyTracker
* org.hibernate.bytecode.enhance.internal.tracker.NoopCollectionTracker
* org.hibernate.bytecode.enhance.internal.tracker.SimpleFieldTracker
/*
* Decompiled with CFR 0.148.
*
* Could not load the following classes:
* javax.persistence.Embedded
* javax.persistence.MappedSuperclass
* org.hibernate.engine.spi.ManagedMappedSuperclass
*/
package org.hibernate.orm.integrationtest.bytecode.model.inline;