Skip to content

Instantly share code, notes, and snippets.

View odrotbohm's full-sized avatar
👨‍💻
@ home

Oliver Drotbohm odrotbohm

👨‍💻
@ home
View GitHub Profile
@odrotbohm
odrotbohm / notes.adoc
Last active August 29, 2015 14:19
Talk notes - Microservices @ unKonf 2015
@odrotbohm
odrotbohm / gist:2f2a070e535b4254cce2
Created April 16, 2015 13:33
hibernate-5-exception.txt
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.443 sec <<< FAILURE!
supportForExpressionBasedQueryMethods(org.springframework.data.jpa.repository.MappedTypeRepositoryIntegrationTests) Time elapsed: 0 sec <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:94)
at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
at org.springframework.test.context.junit4.SpringJUnit4ClassR
@odrotbohm
odrotbohm / after.json
Last active September 4, 2018 08:59
Improved projection links with Spring Data REST
{
"_embedded" : {
"orders" : [ {
"items" : [ {
"description" : "Lakewood guitar",
"price" : 1299.00
} ],
"_embedded" : {
"customer" : {
"address" : "4711 Some Place, 54321 Charlottesville, VA",
@odrotbohm
odrotbohm / blogpost.md
Last active January 12, 2017 15:10
Spring Data Fowler blog post

The GA release of Spring Data release train Fowler marks the finishing line of 6 month of development. It's time to give you an impression of the content of this release and a brief overview about individual features. The major themes of the Fowler release train were performance improvements and enhanced Java 8 support that are mainly reflected in the Spring Data JPA and MongoDB modules but a lot of other ones have seen significant improvements, too.

The easiest way to upgrade to the Spring Data Fowler release train is by using Spring Boot and configuring the spring-data-releasetrain.version property to Fowler-RELEASE. If you're not using Spring Boot yet, add the Spring Data BOM to your <dependencyManagement /> section of your Maven POM.

General themes

Java 8 streams in repository methods

One of Java 8's great new features is the Stream API, which allows Java developers t

Keybase proof

I hereby claim:

  • I am olivergierke on github.
  • I am olivergierke (https://keybase.io/olivergierke) on keybase.
  • I have a public key whose fingerprint is 039A 44B8 6EA1 60D8 C5A7 7234 289F 3090 4F34 EB27

To claim this, I am signing this object:

package foo;
@NoRepositoryBean
interface InternalRepository<T> extends Repository<T, Long> {
<S extends T> save(S entity);
}
package foo;
@odrotbohm
odrotbohm / alps-orders.json
Created June 13, 2014 13:04
Sample ALPS document for Spring RESTBucks orders
{
"version" : "1.0",
"descriptors" : [ {
"id" : "order-representation",
"descriptors" : [ {
"name" : "status",
"doc" : {
"value" : "PAYMENT_EXPECTED, PAID, PREPARING, READY, TAKEN",
"format" : "TEXT"
},
List<Object> nested = new ArrayList<Object>();
nested.addAll(someNesteditems);
nested.addAll(someOtherNestedItems);
SampleResource resource = new SampleResource();
resource.nested = new Resources<Object>(nested);
@odrotbohm
odrotbohm / exception.txt
Last active August 29, 2015 13:57
DataNucleus test errors
[INFO] --- maven-surefire-plugin:2.12:test (datanucleus-tests) @ spring-data-jpa ---
[INFO] Surefire report directory: /Users/olivergierke/Documents/workspace/spring-data-jpa/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
objc[70822]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Running org.springframework.data.jpa.repository.DataNucleusNamespaceUserRepositoryTests
2014-03-13 10:09:51,497 ERROR ramework.test.context.TestContextManager: 309 - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@5f36ba3] to prepare test instance [org.springframework.data.jpa.repository.DataNucleusNamespaceUserRepositoryTes
@odrotbohm
odrotbohm / gist:9067129
Created February 18, 2014 08:53
Renaming collections with Spring Data MongoDB
mongoOps.execute("myCollection", new CollectionCallback<Void> {
public Void doInCollection(DBCollection collection) {
collection.rename("myNewCollection");
}
}