Skip to content

Instantly share code, notes, and snippets.

Don't mix eager or subselect joins with max results; the by product is pretty nasty.
Subselects can select all entities in the associated table, and potentially issue an additional select for each parent, while joins often load duplicate entities due to the max results being applied to the row and not the parent.
@theotherian
theotherian / Jersey ServerSide connector
Last active February 15, 2017 13:05
In memory request handling on the server side with Jersey
It's possible to handle requests in memory with Jersey client
Guava is just better with JMX
There are two dependencies that Jersey 2.0 has for adapting its application to a Servlet instance.
@theotherian
theotherian / Jersey Resource Filters via Custom Annotations
Last active March 5, 2018 17:51
A DynamicFeature implementation for binding filters to resources with Jersey 2.0, in this case flagging certain resources as not supporting Internet Explorer 6.
Files for demonstrating custom binding of Jersey resource filters using annotations
An example of creating an in-memory HSQLDB server
@theotherian
theotherian / Non-Blocking Guava Cache
Last active September 7, 2018 19:46
Blocking on cache reads beyond the first is just plain rude in my opinion, so refresh in the background.
Blocking on cache reads beyond the first is just plain rude in my opinion...
@theotherian
theotherian / Maven Archetypes Part 3
Created July 9, 2013 04:59
Maven Archetype how tos Part 3
Files for creating a Maven Archtype - part 3
@theotherian
theotherian / ClientFactory.java
Last active July 23, 2020 11:21
configuring Jersey 2 client
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import org.apache.http.HttpHost;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.impl.conn.PoolingClientConnectionManager;
import org.glassfish.jersey.apache.connector.ApacheClientProperties;
import org.glassfish.jersey.apache.connector.ApacheConnector;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.ClientProperties;
Files for creating Maven archetypes - part 2