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 / gist:2497116
Created April 26, 2012 07:21
Spring Data REST - Link representation options
1. Current state (1.0.0.M1)
---------------------------
+ Aligned with the XML definition of atom:link.
- Harder to work with for JavaScript clients
GET /root
200 OK
{ _links : [ { rel : "persons", href : "/root/persons" },
@odrotbohm
odrotbohm / components.java
Created April 26, 2012 11:33
Optional and mandatory dependencyies in a Spring component
public interface MyComponent {
void myBusinessMethod(Parameter parameter);
}
/**
* Package protected implementation to avoid clients to use it directly. It contains
* a mandatory and optional dependency where the mandatory one is exposed as constructor
* argument and checked to be not {@literal null}. The optional dependency can be either
* {@literal null} or set from the outside. It's also fine to default this dependency to
GET /events/{id}
200 OK
{ title : "Marathon",
available-lengths: [ 15, 20, 40 ] }
Noch keine registrations
------------------------
GET /users/{id}/registrations
200 OK
compile - Classpath for compiling the main sources.
Download http://repo1.maven.org/maven2/org/springframework/spring-beans/3.1.1.RELEASE/spring-beans-3.1.1.RELEASE.pom
+--- org.slf4j:slf4j-api:1.6.4 [default]
+--- org.springframework:spring-context:3.1.1.RELEASE [default]
| +--- org.springframework:spring-aop:3.1.1.RELEASE [compile,master,runtime]
| | +--- aopalliance:aopalliance:1.0 [compile,master,runtime]
| | +--- org.springframework:spring-beans:3.2.0.M1 [compile,master,runtime]
| | | \--- org.springframework:spring-core:3.2.0.M1 [compile,master,runtime]
| | | \--- org.springframework:spring-asm:3.2.0.M1 [compile,master,runtime]
| | +--- org.springframework:spring-core:3.2.0.M1 [compile,master,runtime] (*)
TransactionSynchronizationManager.initSynchronization();
Connection connection = DataSourceUtils.getConnection(db);
DatabasePopulator populator = EasyMock.createMock(DatabasePopulator.class);
poopulator.populate(connection);
EasyMock.expectLastCall();
EasyMock.replay(populator);
DatabasePopulatorUtils.execute(populator, db);
-------------------------------------------------------------------------------
Test set: com.oreilly.springdata.querydsl.core.ProductUnitTest
-------------------------------------------------------------------------------
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.866 sec <<< FAILURE!
findsAllAppleProducts(com.oreilly.springdata.querydsl.core.ProductUnitTest) Time elapsed: 0.694 sec <<< ERROR!
com.mysema.codegen.CodegenException: Compilation of java.util.List<com.oreilly.springdata.querydsl.core.Product> rv = new java.util.ArrayList<com.oreilly.springdata.querydsl.core.Product>();
for (com.oreilly.springdata.querydsl.core.Product product : product_){
if (product.getDescription().contains(a1)){
rv.add(product);
}
@odrotbohm
odrotbohm / gist:3016896
Created June 29, 2012 09:27
Trying to upgrade STS to 3.0 Milestone 2
An error occurred while collecting items to be installed
session context was:(profile=com.springsource.sts.ide, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,org.eclipse.ajdt.core,2.2.0.e37x-20120627-2200
No repository found containing: osgi.bundle,org.eclipse.ajdt.core.source,2.2.0.e37x-20120627-2200
No repository found containing: osgi.bundle,org.eclipse.ajdt.doc.user,2.2.0.e37x-20120627-2200
No repository found containing: osgi.bundle,org.eclipse.ajdt.examples,2.2.0.e37x-20120627-2200
No repository found containing: osgi.bundle,org.eclipse.ajdt.examples.source,2.2.0.e37x-20120627-2200
No repository found containing: osgi.bundle,org.eclipse.ajdt.mylyn.ui,2.2.0.e37x-20120627-2200
No repository found containing: osgi.bundle,org.eclipse.ajdt.mylyn.ui.source,2.2.0.e37x-20120627-2200
No repository found containing: osgi.bundle,org.eclipse.ajdt.ui,2.2.0.e37x-20120627-2200
@odrotbohm
odrotbohm / gist:3038516
Created July 3, 2012 08:38
Spring IDE build error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7:50.820s
[INFO] Finished at: Mon Jul 02 20:45:05 CEST 2012
[INFO] Final Memory: 240M/437M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.14.1:compile (default-compile) on project org.springframework.ide.eclipse.data.core: Compilation failure: Compilation failure:
[ERROR] /Users/olivergierke/Documents/workspace/spring-ide/plugins/org.springframework.ide.eclipse.data.core/src/main/java/org/springframework/ide/eclipse/data/jdt/core/EntityPropertyCompletionProposals.java:[46,0]
[ERROR] private static final Image KEYWORD = IMAGES.getImage(ISharedImages.IMG_OBJS_ANNOTATION);
@odrotbohm
odrotbohm / gist:3038721
Created July 3, 2012 09:24
Spring IDE build log
Serendipity:spring-ide @ master olivergierke$ mvn -Pe37 clean package
[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: org.springframework.ide.eclipse:org.springframework.ide.eclipse:3.0.0-SNAPSHOT @ /Users/olivergierke/Documents/workspace/spring-ide/plugins/org.springframework.ide.eclipse/pom.xml
[INFO] Fetching p2.index (0B of 96B at 0B/s) from http://download.eclipse.org/eclipse/updates/3.7/
[INFO] Fetching p2.index (128B of 96B at 0B/s) from http://download.eclipse.org/eclipse/updates/3.7/
[INFO] 1 operation remaining.
[INFO] Adding repository http://download.eclipse.org/eclipse/updates/3.7/
[INFO] Fetching p2.index (0B of 96B at 0B/s) from http://download.eclipse.org/eclipse/updates/3.7/
[INFO] Fetching p2.index (128B of 96B at 0B/s) from http://download.eclipse.org/eclipse/updates/3.7/
[INFO] Adding repository http://download.eclipse.org/eclipse/updates/3.7/
@odrotbohm
odrotbohm / gist:3090056
Created July 11, 2012 12:23
Maven grabbing yet another half of the internet
Serendipity:spring-data-jpa @ DATAJPA-69 olivergierke$ mvn dependency:list
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Spring Data JPA 1.2.0.JAVACONFIG-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.springsource.org/libs-snapshot/org/springframework/spring-beans/maven-metadata.xml
Downloaded: http://repo.springsource.org/libs-snapshot/org/springframework/spring-beans/maven-metadata.xml (3 KB at 4.3 KB/sec)
Downloading: http://repo.springsource.org/libs-snapshot/org/springframework/spring-beans/3.0.8.BUILD-SNAPSHOT/maven-metadata.xml
Downloaded: http://repo.springsource.org/libs-snapshot/org/springframework/spring-beans/3.0.8.BUILD-SNAPSHOT/maven-metadata.xml (373 B at 0.8 KB/sec)