Skip to content

Instantly share code, notes, and snippets.

View adrianmilne's full-sized avatar

Adrian Milne adrianmilne

View GitHub Profile
SELECT ID, NAME
XMLTYPE(u.accountxml).EXTRACT('/person/account/sortCode/text()') as SORTCODE
FROM USER u;
package com.cor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
/**
* Spring Boot launch file.
*/
@ComponentScan
package com.cor.controller;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.Resource;
import org.springframework.http.MediaType;
package com.cor.controller;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.methodOn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.Resource;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
package com.cor.domain;
/**
* Album (available to purchase - hence 'stockLevel' attribute).
*
*/
public class Album {
private final String id;
private final String title;
package com.cor.domain;
/**
* Music Artist/Group.
*
*/
public class Artist {
private final String id;
private final String name;
package com.cor.service;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.cor.domain.Album;
import com.cor.domain.Artist;
/**
<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>com.cor</groupId>
<artifactId>spring-hateoas-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-hateoas-demo</name>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
@adrianmilne
adrianmilne / cometd-application.properties
Created April 17, 2013 21:34
CometD Camel demo - application.properties
broker.url=tcp://localhost:61616
broker.queue=corsoft.BroadcastMessageQueue
cometd.channel=cometd://0.0.0.0:9099/broadcastMessageChannel
@adrianmilne
adrianmilne / cometd-consumer.js
Created April 17, 2013 21:40
CometD consumer javascript
google.load("jquery", "1");
/**
* Callback function - Cometd consumer.
*/
google.setOnLoadCallback(function() {
$.getScript("http://jquerycomet.googlecode.com/svn/trunk/jquery.comet.js", function(){
console.log("done loading js");
$.comet.init("http://localhost:9099/cometd");
$.comet.subscribe("/broadcastMessageChannel", broadcastListener);