This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
import Keys._ | |
import com.github.siasia.WebPlugin | |
object Build extends sbt.Build { | |
import Dependencies._ | |
lazy val myProject = Project( | |
"billratecalc", | |
file("."), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns quadbot.persistence | |
(:use [korma.db]) | |
(:use [korma.core]) | |
(:use [clojure.test])) | |
(defdb mydb {:classname "org.h2.Driver" | |
:subprotocol "h2" | |
:subname "jdbc:h2:~/test" | |
:user "sa" | |
:password ""}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quadbot.client=> (use 'quadbot.persistence :reload-all) | |
nil | |
quadbot.client=> (insert-select) | |
WARN com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2 20111125 165018,291 com.mchange.v2.resourcepool.BasicResourcePool ] com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@1bfa1ba1 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: | |
org.h2.jdbc.JdbcSQLException: Error opening database: "Could not load properties /Users/craiger/src/OSS/quadbot/h2:~/test.lock.db" [8000-161] | |
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329) | |
at org.h2.message.DbException.get(DbException.java:158) | |
at org.h2.store.FileLock.getExceptionFatal(FileLock.java:431) | |
at org.h2.store.FileLock.load(FileLock.java:261) | |
at org.h2.store.FileLock.checkServer(FileLock.java:214) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quadbot.client=> (use 'quadbot.persistence :reload-all) | |
nil | |
quadbot.client=> (def ident (invoke-with-connection insert-users2)) | |
#'quadbot.client/ident | |
quadbot.client=> (println ident) | |
{:SCOPE_IDENTITY() 29} | |
nil | |
quadbot.client=> (:SCOPE_IDENTITY() ident) | |
{:SCOPE_IDENTITY() 29} | |
quadbot.client=> (first ident) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns my.ns | |
(:use [korma.db]) | |
(:use [korma.core]) | |
(:require [clojure.java.jdbc :as sql])) | |
(def dbspec {:classname "org.h2.Driver" | |
:subprotocol "h2" | |
:subname "~/db/myapp" | |
:user "sa" | |
:password ""}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#to INSTALL: download source and type checkinstall -D instead of make install | |
sudo checkinstall -D | |
#if you want an entire repo with *all history* | |
git-svn clone https://my.server/repo/myproj/trunk | |
###### if you want only a subset of history ######### | |
#initialize a working folder to be used with git-svn | |
git-svn init https://my.server/repo/myproj/trunk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ ============= WSDL ================] | |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" | |
xmlns:tns="http://ws.mlc.mb.ca/playerManagement/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="playerManagement" | |
targetNamespace="http://ws.mlc.mb.ca/playerManagement/"> | |
<wsdl:types> | |
<xsd:schema targetNamespace="http://ws.mlc.mb.ca/playerManagement/" xmlns:pm="http://ws.mlc.mb.ca/playerManagement/"> | |
<xsd:element name="wsPlayer"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity(name="Player") | |
public class PlayerImpl implements Player { | |
@Id | |
@Column(name="PlayerId") | |
private Integer id = -1; | |
private PersonName name = new PersonNameImpl(); | |
. | |
. | |
. | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity(name = "Player") | |
public class PlayerImpl implements Player { | |
@Id | |
@Column(name = "PlayerId") | |
private Integer id = -1; | |
@Embedded | |
private PersonName name; //to get this to work, I have to re-type this as PersonNameImpl and cast in the setter | |
public PersonName getName() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testRetrieveById() { | |
//uses the localhost:8080/PlayerManagement address from the WSDL <soap:address> element | |
PlayerManagement client = new PlayerManagement_Service().getPlayerManagementSOAP(); | |
WsPlayer player = client.retrievePlayerById(1); | |
assertNotNull(player); | |
assertEquals("Dollie", player.getFirstName()); | |
} |
OlderNewer