Skip to content

Instantly share code, notes, and snippets.

View jbrackett's full-sized avatar

Josh Brackett jbrackett

View GitHub Profile
@jbrackett
jbrackett / build.gradle
Last active April 14, 2021 11:01
Build file with task to generate Querydsl classes from SQL
configurations {
querydslsql
}
sourceSets { generated }
sourceSets.generated.java.srcDirs = ['src/main/generated']
ext {
sqlserverVersion = "1.3.1"
queryDslVersion = "3.6.1"
@jbrackett
jbrackett / PersonRepositoryTest.java
Last active August 29, 2015 13:56
Test for spring-data-jpa tutorial
package com.example.repositories;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.List;
import javax.annotation.Resource;
@jbrackett
jbrackett / Person.java
Created February 10, 2014 22:58
Repository and Domain for spring-data-jpa tutorial
package com.example.domain;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@jbrackett
jbrackett / AppConfig.java
Created February 10, 2014 22:48
Application configuration for spring-data-jpa tutorial
package com.example;
import java.util.Properties;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.hibernate.cfg.Environment;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@jbrackett
jbrackett / build.gradle
Created February 10, 2014 22:35
Build file for spring-data-jpa tutorial
apply plugin: "java"
apply plugin: "eclipse"
apply plugin: "idea"
sourceCompatibility = 1.7
repositories {
mavenCentral()
}
@jbrackett
jbrackett / HelloControllerTest.java
Last active August 29, 2015 13:56
HelloWorldSpring4Test
package com.hello.controller;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@jbrackett
jbrackett / app.js
Created February 10, 2014 02:30
HelloWorldSpring4View
/*jshint unused: false */
/*global angular:true */
// Declare app level module
var App = angular.module('App', []);
(function() {
'use strict';
App.controller("HelloCtrl", ['$scope', '$http',
function($scope, $http) {
$scope.name = "User";
@jbrackett
jbrackett / HelloController.java
Created February 10, 2014 02:22
HelloWorldSpring4Controller
package com.hello.controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/hello")
public class HelloController {
@jbrackett
jbrackett / AppConfig.java
Last active August 29, 2015 13:56
HelloWorldSpring4Configuration
package com.hello;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@Configuration
@ComponentScan(basePackages = { "com.hello.controller", "com.hello.config" })
public class AppConfig {
}
@jbrackett
jbrackett / build.gradle
Created February 10, 2014 01:52
HelloWorldSpring4Build
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "war"
apply plugin: "tomcat"
war { baseName='hello-world' }
sourceCompatibility = 1.7
buildscript {