Skip to content

Instantly share code, notes, and snippets.

View michael-simons's full-sized avatar

Michael Simons michael-simons

View GitHub Profile
NamedNativeQuery(
name="Foobar.findByBlahAndBlub"
query="Select * from foobar where blah_id = :blah and lower(blub) = :blub"
)
Optional<Foobar> findByBlahAndBlub(Blah blah, String blub);
@michael-simons
michael-simons / gist:fc401f19817e207ad747b86dfe8fc649
Created July 5, 2016 14:39
Error upgrading wro4j-spring-boot-starter
Checking compile classpath
Checking runtime classpath
Checking test classpath
Found duplicate (but equal) classes in [net.minidev:accessors-smart:1.1, org.ow2.asm:asm:5.0.3]:
org.objectweb.asm.AnnotationVisitor
org.objectweb.asm.AnnotationWriter
org.objectweb.asm.Attribute
org.objectweb.asm.ByteVector
org.objectweb.asm.ClassReader
org.objectweb.asm.ClassVisitor
@michael-simons
michael-simons / T_SBFA_ASPECT_INSTANCE_FACTORY.SQL
Created July 12, 2016 07:33
SimpleBeanFactoryAwareAspectInstanceFactory
CREATE OR REPLACE TYPE T_SBFA_ASPECT_INSTANCE_FACTORY AS OBJECT (
CONSTRUCTOR FUNCTION T_SBFA_ASPECT_INSTANCE_FACTORY RETURN self AS result,
MEMBER PROCEDURE SET_ASPECT_BEAN_NAME(P_ASPECT_BEAN_NAME IN VARCHAR2),
MEMBER FUNCTION GETASPECTINSTANCE RETURN OBJECT
)
/
package patternexamples;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Function;
public class Sandwich {
private final String bread;
@michael-simons
michael-simons / Dockerfile
Created July 26, 2016 10:06
Feedback for Bruno and Gerald
# this is create_tablespace_and_user.sql
-- Change to PDB which was created inside parent iamge
ALTER SESSION SET CONTAINER = ORCLPDB1;
-- Enable Enterprise Manager Express on port 5501
EXEC dbms_xdb_config.sethttpsport(5501);
-- Create table space for demo application
CREATE SMALLFILE TABLESPACE "DOAG2016"
@michael-simons
michael-simons / redirect.sh
Created August 22, 2016 15:57
Redirect TCP traffic to Docker socket
socat TCP-LISTEN:2376,reuseaddr,fork UNIX-CLIENT:/var/run/docker.sock
@michael-simons
michael-simons / integration-database-from-oracle-database-docker-image.xml
Created August 26, 2016 13:54
Stanza from a Maven pom.xml that creates an integration database from oracle/database docker image, adds a user and a tablespace through a sql file
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.15.16</version>
<configuration>
<images>
<image>
<name>enerko/ihldb</name>
package ac.simons.wjax2016.starter;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.thymeleaf.spring4.SpringTemplateEngine;
@Configuration
@ConditionalOnClass({SpringTemplateEngine.class, ThymeleafAutoConfiguration.class})
@michael-simons
michael-simons / ThingEntity.java
Last active October 19, 2020 16:15
An example on how to use Hibernate-Spatial with Spring Data JPA Repositories
@Entity
@Table(name = "things")
public class ThingEntity {
@Id
private Long id;
// Needed for use with Hibernate Spatial 4.x
// @Type(type = "org.hibernate.spatial.GeometryType")
private Geometry geometry;
public class Foobar {
public enum Bazbar {
BAR,
BAZ {public void fump() {System.out.println("Baz");}},
FUMP;
public void fump(){System.out.println("Bazbar");}
}
public static void main(String...a) {