From 123ba27acdca573824b5c960f3bfdc43e7426929 Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Mon, 3 Apr 2017 11:25:47 -0400 Subject: [PATCH] Initial import. --- .gradle/2.2/taskArtifacts/cache.properties | 1 + .../2.2/taskArtifacts/cache.properties.lock | Bin 0 -> 17 bytes .gradle/2.2/taskArtifacts/fileHashes.bin | Bin 0 -> 21232 bytes .gradle/2.2/taskArtifacts/fileSnapshots.bin | Bin 0 -> 26241 bytes .../2.2/taskArtifacts/outputFileStates.bin | Bin 0 -> 18692 bytes .gradle/2.2/taskArtifacts/taskArtifacts.bin | Bin 0 -> 20625 bytes .idea/modules/farsite_main.iml | 90 + .idea/modules/farsite_test.iml | 94 ++ build.gradle | 106 ++ dependencies.lock | 360 ++++ farsite.iml | 22 + farsite.ipr | 481 ++++++ farsite.iws | 1467 +++++++++++++++++ src/META-INF/persistence.xml | 47 + src/main/java/com/example/farsite/Main.java | 36 + .../com/example/farsite/model/Family.java | 19 + .../java/com/example/farsite/model/Job.java | 16 + .../com/example/farsite/model/Person.java | 32 + .../java/com/example/farsite/model/Todo.java | 18 + .../com/example/farsite/model/JpaTest.java | 107 ++ 20 files changed, 2896 insertions(+) create mode 100644 .gradle/2.2/taskArtifacts/cache.properties create mode 100644 .gradle/2.2/taskArtifacts/cache.properties.lock create mode 100644 .gradle/2.2/taskArtifacts/fileHashes.bin create mode 100644 .gradle/2.2/taskArtifacts/fileSnapshots.bin create mode 100644 .gradle/2.2/taskArtifacts/outputFileStates.bin create mode 100644 .gradle/2.2/taskArtifacts/taskArtifacts.bin create mode 100644 .idea/modules/farsite_main.iml create mode 100644 .idea/modules/farsite_test.iml create mode 100644 build.gradle create mode 100644 dependencies.lock create mode 100644 farsite.iml create mode 100644 farsite.ipr create mode 100644 farsite.iws create mode 100644 src/META-INF/persistence.xml create mode 100644 src/main/java/com/example/farsite/Main.java create mode 100644 src/main/java/com/example/farsite/model/Family.java create mode 100644 src/main/java/com/example/farsite/model/Job.java create mode 100644 src/main/java/com/example/farsite/model/Person.java create mode 100644 src/main/java/com/example/farsite/model/Todo.java create mode 100644 src/test/java/com/example/farsite/model/JpaTest.java diff --git a/.gradle/2.2/taskArtifacts/cache.properties b/.gradle/2.2/taskArtifacts/cache.properties new file mode 100644 index 0000000..5fe0b69 --- /dev/null +++ b/.gradle/2.2/taskArtifacts/cache.properties @@ -0,0 +1 @@ +#Fri Mar 31 21:55:13 EDT 2017 diff --git a/.gradle/2.2/taskArtifacts/cache.properties.lock b/.gradle/2.2/taskArtifacts/cache.properties.lock new file mode 100644 index 0000000000000000000000000000000000000000..e244035015401141a6352dbf83e16254b50020c4 GIT binary patch literal 17 TcmZRc=%qU&FpgW50Rs8~A@~Cl literal 0 HcmV?d00001 diff --git a/.gradle/2.2/taskArtifacts/fileHashes.bin b/.gradle/2.2/taskArtifacts/fileHashes.bin new file mode 100644 index 0000000000000000000000000000000000000000..402cf5cee23e968d9578c1da1660b8794fbe6471 GIT binary patch literal 21232 zcmeI3dpMNa9>?FY6;l*ap<}z2OKo>WLJ3ioLto zE`_MAa+!2e$tKdNgGzQKCMum-@0zu@dHeJHcb+xR<6V4O-}krHXRUejJZAA$6NG}y zSK*78^2(}femCVu{4F+s4PXP<05*UPU<23yHh>La1K0pIfDK>+*Z?+w4PXP<05*UP z{GS-$c?u>n15QR^sTldqvyN%|d3y-LKuYkVVZ1#3UpXsQo`ZeZ+t6PU5`KLu$N4d< z7IN47h#%5Ek>sX$`90*0`iOJAR@|=1$O(tsMIP~#tX1Vwp-%CTvr-XH<M3xQ~rZeaXsYD z>kx1KbW8sAl3EGK+1-eDr|%xE=PWURoY{kTUs0fjzme}+;r-J%AE+MZ*{KcT<`r5?1`j9)tAl`r1Ff&Z%$uE$*)F3`m-0PoN>#-bimKWmu z`VI9_n<~{HcZ)`xZtb=}f1QRiB1i6bd;#yyF zBlM_^6(k zCM!l9ayL5S#vig>^X;;EkUKXaZmy>DNvfd7UwD54ahur_A)UT~Hp2VgLfp3TP4rNi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WM3 z1)eBBpPW%nXm05N?qzseQ zZz{InrST1|+!;NK8tr?@7_(XdbSDT;4!BmYN#|2y*2Z>nL2KGnn{%?w4X=-05sl3v z-w0}lzQSKsraX?W-|z4wMr64RSo)m>qCK1pZnfboM(Ms%_ogJ&R&C4hFqOYvti lHf5A?ZwEC#rM1|`wiV7-Xf-H@xs$>*5PJ`D2OKiu{tGPnMeqOs literal 0 HcmV?d00001 diff --git a/.gradle/2.2/taskArtifacts/fileSnapshots.bin b/.gradle/2.2/taskArtifacts/fileSnapshots.bin new file mode 100644 index 0000000000000000000000000000000000000000..892b3d1e8ec295053af6275c0f600487373eff37 GIT binary patch literal 26241 zcmeHQd6ZP;mG4FzK%zDnqmZcM3Zhl-ecM|O8JwUfMmA#*qXK?wcXd}+wN=%CL}vss zktRWjsGx~XFnUmuqY)7o2rj5JwqQtX88A@;!6n#7b52Aw;M}(qREIQY3YmZAJm^>N z)urz3`~AMVf6#PXP*Zba-52q%nu=d{t#1Fg;%)MnAdn!CAdn!CAdn!CAdn!CAdn!C zAdn!CAdn!CAdn!CAdn!CAdn!CAdn#N{{(@KiLj8PqQ#u(^a>x|={)j3I;Pju*k6IS z$J}+)k<0M*k*lK5s2SyxgvAf-*|0ZlUmnrLhBAF=*Yx3CJMuS1^wGP@^v6%$^!?s5 z{(47DpHQZ+9Jpf8kABcNGNP-_GJW;(w%Q_Ieoy@QWo3Hj?c@9XY|YZ05nal=hK&d7|{(Y)Bk?S*Bd_>bmioTu5g*&=LFsP*6~-p6w8@k zrhjYs^bM1WvtNxrKe$Z)_8;E5Z}-)ou8HYgW%{I%i*{@|?u{2?`fX);`5w?Ox@y#p z=+Bea1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB z1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB1c3yB1cAegKnDSNW8oSV zUbT-}6N|b~wCY7`L0Qv_mf?kBrlc*=n#n3l=@y++Iw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zR0ILAHsis-f$d8P2MVf8WrLb8e5GI8PfG8$-LUE0meEUtW1Y74lWB0QQwv8#wQxjK z>(usI*3B0yreM+OlMITh;Cu%2I-rwpach zZ~ps&n&J07bN$i1+E4gnTgT4>EFZl2cLT!Xw%})f1wZyH`q5uCKPkQbX-M~gW(QYo z?Js)5E1oB&GtJrBel_QPYuxjD&H|R2ngLfg4L^L+TMD(uzx~*&U!6O+A(X!Uq+{nE zKIzkowWHTR^`3p~!11B<_vMlZfidtF{_hmHsz2kb>;KT0KlR@7L3@71)GMFE_6vdN vp+9yaR1V`2=a)Q*{bI_I%g@S;nDe#W!_3}EjVA@*{;d!3XRI8j3x8hO zB7gt_2q1s}0tg_000IagfB*srAbh*@G!PpE7cH?xtYNIMRB)Y2?AM zZ!JFAv#sYzBacM;UgtZ#XL>$h(`e4J?#`v1Q0*~0R#|0009ILKmY**5I_I{ z1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY**5YPmac6GI@(;{cR+ag*M zb6MGqpLpNQ?ZoIyV52EEE!)q<{i3;DJ`5bJ`t}mCy${qqncE8C>yDfj8)cikUD`3X gHTm5u=R$2vw$1TttGNwb9zA-h9sRNm`)7N90C8xKs{jB1 literal 0 HcmV?d00001 diff --git a/.gradle/2.2/taskArtifacts/taskArtifacts.bin b/.gradle/2.2/taskArtifacts/taskArtifacts.bin new file mode 100644 index 0000000000000000000000000000000000000000..de9a0847d83a643f4be3fb12b334c57c2b771b9f GIT binary patch literal 20625 zcmeI&UuYaf7y$6uyPTjFtyZC=t@g#*YP%N^YAvX=xy007OiPSHq1w6Kx!p-7yX(yE z{i{~3NX3Fwn+BpSS}hh@C1_fuY4t$_Ut*Dh;)9?eNU%k%wv+&ne@VD>X5vuW<3oc{JZr`A$%A8b-+eo?)%f{1p4c|_+rX}d zR1|OfK8`Pb;eiDoo@=i}@%Bm_kJl>Rdhx}Nqy4Z10T2KI5C8!X009sH0T2KI5C8!X z009sH0T2KI5C8!X009sH0T2KI5C8!X009sH0T2KI5C8!X009sH0T2KI5C8!Xn2o^5 z-SViNvZ;UUSF}CX9zJ`X9hqeP&V{k9_ir3_NG@Pl_gG+2M>mN_9FsUknYl)f?qks- z^iEtLS=oI=_MXTP!{yi~rc9?DNp}gtMcT>*+)NimI*+-aK1tW|P$G1dN*;~SXO*V4 zs-9$7wkK87Dl5+|KD+nrMWgS3dCQi@!{b9Pw{(kRlMx+zv|54T_IgxC9>N9O9Bof2 zByn`QLUI9RX4+s_2qMzGm^y6+BB!gAk?qo$m9D;_NDWJ!Ur@Sxh|=3LirR(2lt?Qqx2@%bUC3i;^H8Rx7z zU)7;%=Z8b8^XCB7=VNXWUuDET%~3}Ea#TX{E`80uT4~W8!vC4y>v6g%QgxTTV#dqP z)cL*^r^?q&a9yV5GiGZ2>!d#62HYUi0KD;c!;lg&0w3oX3FlAU8UrU=(&1}iyX*+n zwE2T4J~;jSs?&Dy_QXA%%abSSDvDkWLZ>EC4eJjQhp1P;2H9zM&47_952JQyx+kpq zcF<`rQ+1%0y?5lpLY|TxUp38M^5ev%M}OIT`G?k1_T+814$robP2BA!hCkOzJgy2s z_P|YcSji6ADX6B6Hgz8SrtyzwZv5oaV>ee?mz|nzC6CGZk`IhAXO*Iw3xrnmeYY~K z<#*Y+pjsl^{A>O_yW^c#*9 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules/farsite_test.iml b/.idea/modules/farsite_test.iml new file mode 100644 index 0000000..85b0f87 --- /dev/null +++ b/.idea/modules/farsite_test.iml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..07cdd16 --- /dev/null +++ b/build.gradle @@ -0,0 +1,106 @@ +// gradle wrapper +// ./gradlew clean generateLock saveLock +// ./gradlew compileJava +// ./gradlew run +// ./gradlew run --debug-jvm + +buildscript { + ext { + } + repositories { + jcenter() + mavenCentral() + maven { url "https://clojars.org/repo" } + } + dependencies { + classpath 'com.netflix.nebula:gradle-dependency-lock-plugin:4.+' + classpath 'com.uber:okbuck:0.19.0' + } +} + +apply plugin: 'java' +apply plugin: 'idea' +apply plugin: 'com.uber.okbuck' +apply plugin: 'nebula.dependency-lock' +apply plugin: 'application' + +mainClassName = "com.example.farsite.Main" +applicationDefaultJvmArgs = ["-Dgreeting.language=en"] + +task execute(type:JavaExec) { + classpath = sourceSets.main.runtimeClasspath + main = project.hasProperty("mainClass") ? project.getProperty("mainClass") : "com.example.farsite.Main" +} + +dependencies { + testCompile 'junit:junit:4.12' +} + +jar { + baseName = '' + version = '0.0.1-SNAPSHOT' +} + +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +repositories { + jcenter() + mavenLocal() + mavenCentral() + maven { url "https://clojars.org/repo" } +} + +configurations { + compile.exclude module: 'spring-boot-starter-tomcat' + compile.exclude module: 'tomcat-jdbc' +} + +configurations.all { + exclude group: "org.slf4j", module: "slf4j-log4j12" + exclude group: "log4j", module: "log4j" +} + +dependencies { + // Some Java Extras + compile group: 'javax.inject', name: 'javax.inject', version: '1' + + // Google Guava, "For all the Goodness(TM)" + compile group: 'com.google.guava', name: 'guava', version: '21.+' + + // Joda Time, "Because time is hard(TM)" + compile group: 'joda-time', name: 'joda-time', version: '2.+' + + // Lombok, "Where less is more(TM)" + compile group: 'org.projectlombok', name: 'lombok', version: '1.+' + + // Entity Storage (aka. txn{CRUD}), "Things necessary for data persistence" + // - CockroachDB (the *clustered, scale-out* PostgreSQL server) + // - HikariCP (Connection Pooling) + // - EclipseLink (ORM) + compile group: 'org.postgresql', name: 'postgresql', version: '42.+' + compile group: 'org.eclipse.persistence', name: 'eclipselink', version: '2.+' + compile group: 'org.eclipse.persistence', name: 'javax.persistence', version: '2.+' + compile group: 'org.eclipse.persistence', name: 'org.eclipse.persistence.jpa', version: '2.+' + + + // Dropwizard (aka. CodaHale) Metrics, "Measure all the things!(TM)" + compile group: 'io.dropwizard.metrics', name: 'metrics-core', version: '3.+' + compile group: 'io.dropwizard.metrics', name: 'metrics-jvm', version: '3.+' + compile group: 'io.dropwizard.metrics', name: 'metrics-healthchecks', version: '3.+' + compile group: 'io.dropwizard.metrics', name: 'metrics-graphite', version: '3.+' + compile group: 'io.riemann', name: 'metrics3-riemann-reporter', version: '0.+' + + // Logging for Java, "Visibility proceeds insight(TM)" + compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.+' + compile group: 'org.slf4j', name: 'log4j-over-slf4j', version: '1.+' + compile group: 'org.zalando', name: 'logbook-core', version: '1.+' + + // Fake data generator + compile group: 'com.github.javafaker', name: 'javafaker', version: '0.+' + +} + +task wrapper(type: Wrapper) { + gradleVersion = '2.2' +} diff --git a/dependencies.lock b/dependencies.lock new file mode 100644 index 0000000..f01cd66 --- /dev/null +++ b/dependencies.lock @@ -0,0 +1,360 @@ +{ + "compile": { + "ch.qos.logback:logback-classic": { + "locked": "1.2.3", + "requested": "1.+" + }, + "com.github.javafaker:javafaker": { + "locked": "0.13", + "requested": "0.+" + }, + "com.google.guava:guava": { + "locked": "21.0", + "requested": "21.+" + }, + "io.dropwizard.metrics:metrics-core": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-graphite": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-healthchecks": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-jvm": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.riemann:metrics3-riemann-reporter": { + "locked": "0.4.3", + "requested": "0.+" + }, + "javax.inject:javax.inject": { + "locked": "1", + "requested": "1" + }, + "joda-time:joda-time": { + "locked": "2.9.9", + "requested": "2.+" + }, + "org.eclipse.persistence:eclipselink": { + "locked": "2.6.4", + "requested": "2.+" + }, + "org.eclipse.persistence:javax.persistence": { + "locked": "2.1.1", + "requested": "2.+" + }, + "org.eclipse.persistence:org.eclipse.persistence.jpa": { + "locked": "2.6.4", + "requested": "2.+" + }, + "org.postgresql:postgresql": { + "locked": "42.0.0", + "requested": "42.+" + }, + "org.projectlombok:lombok": { + "locked": "1.16.16", + "requested": "1.+" + }, + "org.slf4j:log4j-over-slf4j": { + "locked": "1.7.25", + "requested": "1.+" + }, + "org.zalando:logbook-core": { + "locked": "1.1.1", + "requested": "1.+" + } + }, + "default": { + "ch.qos.logback:logback-classic": { + "locked": "1.2.3", + "requested": "1.+" + }, + "com.github.javafaker:javafaker": { + "locked": "0.13", + "requested": "0.+" + }, + "com.google.guava:guava": { + "locked": "21.0", + "requested": "21.+" + }, + "io.dropwizard.metrics:metrics-core": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-graphite": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-healthchecks": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-jvm": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.riemann:metrics3-riemann-reporter": { + "locked": "0.4.3", + "requested": "0.+" + }, + "javax.inject:javax.inject": { + "locked": "1", + "requested": "1" + }, + "joda-time:joda-time": { + "locked": "2.9.9", + "requested": "2.+" + }, + "org.eclipse.persistence:eclipselink": { + "locked": "2.6.4", + "requested": "2.+" + }, + "org.eclipse.persistence:javax.persistence": { + "locked": "2.1.1", + "requested": "2.+" + }, + "org.eclipse.persistence:org.eclipse.persistence.jpa": { + "locked": "2.6.4", + "requested": "2.+" + }, + "org.postgresql:postgresql": { + "locked": "42.0.0", + "requested": "42.+" + }, + "org.projectlombok:lombok": { + "locked": "1.16.16", + "requested": "1.+" + }, + "org.slf4j:log4j-over-slf4j": { + "locked": "1.7.25", + "requested": "1.+" + }, + "org.zalando:logbook-core": { + "locked": "1.1.1", + "requested": "1.+" + } + }, + "runtime": { + "ch.qos.logback:logback-classic": { + "locked": "1.2.3", + "requested": "1.+" + }, + "com.github.javafaker:javafaker": { + "locked": "0.13", + "requested": "0.+" + }, + "com.google.guava:guava": { + "locked": "21.0", + "requested": "21.+" + }, + "io.dropwizard.metrics:metrics-core": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-graphite": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-healthchecks": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-jvm": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.riemann:metrics3-riemann-reporter": { + "locked": "0.4.3", + "requested": "0.+" + }, + "javax.inject:javax.inject": { + "locked": "1", + "requested": "1" + }, + "joda-time:joda-time": { + "locked": "2.9.9", + "requested": "2.+" + }, + "org.eclipse.persistence:eclipselink": { + "locked": "2.6.4", + "requested": "2.+" + }, + "org.eclipse.persistence:javax.persistence": { + "locked": "2.1.1", + "requested": "2.+" + }, + "org.eclipse.persistence:org.eclipse.persistence.jpa": { + "locked": "2.6.4", + "requested": "2.+" + }, + "org.postgresql:postgresql": { + "locked": "42.0.0", + "requested": "42.+" + }, + "org.projectlombok:lombok": { + "locked": "1.16.16", + "requested": "1.+" + }, + "org.slf4j:log4j-over-slf4j": { + "locked": "1.7.25", + "requested": "1.+" + }, + "org.zalando:logbook-core": { + "locked": "1.1.1", + "requested": "1.+" + } + }, + "testCompile": { + "ch.qos.logback:logback-classic": { + "locked": "1.2.3", + "requested": "1.+" + }, + "com.github.javafaker:javafaker": { + "locked": "0.13", + "requested": "0.+" + }, + "com.google.guava:guava": { + "locked": "21.0", + "requested": "21.+" + }, + "io.dropwizard.metrics:metrics-core": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-graphite": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-healthchecks": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-jvm": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.riemann:metrics3-riemann-reporter": { + "locked": "0.4.3", + "requested": "0.+" + }, + "javax.inject:javax.inject": { + "locked": "1", + "requested": "1" + }, + "joda-time:joda-time": { + "locked": "2.9.9", + "requested": "2.+" + }, + "junit:junit": { + "locked": "4.12", + "requested": "4.12" + }, + "org.eclipse.persistence:eclipselink": { + "locked": "2.6.4", + "requested": "2.+" + }, + "org.eclipse.persistence:javax.persistence": { + "locked": "2.1.1", + "requested": "2.+" + }, + "org.eclipse.persistence:org.eclipse.persistence.jpa": { + "locked": "2.6.4", + "requested": "2.+" + }, + "org.postgresql:postgresql": { + "locked": "42.0.0", + "requested": "42.+" + }, + "org.projectlombok:lombok": { + "locked": "1.16.16", + "requested": "1.+" + }, + "org.slf4j:log4j-over-slf4j": { + "locked": "1.7.25", + "requested": "1.+" + }, + "org.zalando:logbook-core": { + "locked": "1.1.1", + "requested": "1.+" + } + }, + "testRuntime": { + "ch.qos.logback:logback-classic": { + "locked": "1.2.3", + "requested": "1.+" + }, + "com.github.javafaker:javafaker": { + "locked": "0.13", + "requested": "0.+" + }, + "com.google.guava:guava": { + "locked": "21.0", + "requested": "21.+" + }, + "io.dropwizard.metrics:metrics-core": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-graphite": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-healthchecks": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.dropwizard.metrics:metrics-jvm": { + "locked": "3.2.2", + "requested": "3.+" + }, + "io.riemann:metrics3-riemann-reporter": { + "locked": "0.4.3", + "requested": "0.+" + }, + "javax.inject:javax.inject": { + "locked": "1", + "requested": "1" + }, + "joda-time:joda-time": { + "locked": "2.9.9", + "requested": "2.+" + }, + "junit:junit": { + "locked": "4.12", + "requested": "4.12" + }, + "org.eclipse.persistence:eclipselink": { + "locked": "2.6.4", + "requested": "2.+" + }, + "org.eclipse.persistence:javax.persistence": { + "locked": "2.1.1", + "requested": "2.+" + }, + "org.eclipse.persistence:org.eclipse.persistence.jpa": { + "locked": "2.6.4", + "requested": "2.+" + }, + "org.postgresql:postgresql": { + "locked": "42.0.0", + "requested": "42.+" + }, + "org.projectlombok:lombok": { + "locked": "1.16.16", + "requested": "1.+" + }, + "org.slf4j:log4j-over-slf4j": { + "locked": "1.7.25", + "requested": "1.+" + }, + "org.zalando:logbook-core": { + "locked": "1.1.1", + "requested": "1.+" + } + } +} \ No newline at end of file diff --git a/farsite.iml b/farsite.iml new file mode 100644 index 0000000..28a9b57 --- /dev/null +++ b/farsite.iml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/farsite.ipr b/farsite.ipr new file mode 100644 index 0000000..cd425e0 --- /dev/null +++ b/farsite.ipr @@ -0,0 +1,481 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.6 + + + + + + + + + + + + + \ No newline at end of file diff --git a/farsite.iws b/farsite.iws new file mode 100644 index 0000000..4a964ce --- /dev/null +++ b/farsite.iws @@ -0,0 +1,1467 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Assembles and tests this project and all projects that depend on it.<p><i>Task group: build<i> + Generates IDEA project files (IML, IPR, IWS)<p><i>Task group: IDE<i> + Assembles classes 'main'.<p><i>Task group: build<i> + Delete stale configuration files generated by OkBuck<p><i>Task group: okbuck<i> + Setup okbuck cache and dependencies<p><i>Task group: okbuck<i> + Move the generated lock file into the project directory<p><i>Task group: Locking<i> + Runs this project as a JVM application<p><i>Task group: application<i> + <i>Task group: other<i> + Apply updates to a preexisting lock file and write to build/<specified name><p><i>Task group: Locking<i> + <i>Task group: other<i> + Assembles classes 'test'.<p><i>Task group: build<i> + Generates Javadoc API documentation for the main source code.<p><i>Task group: documentation<i> + Creates OS specific scripts to run the project as a JVM application.<p><i>Task group: other<i> + Assembles a jar archive containing the main classes.<p><i>Task group: build<i> + Create buck wrapper<p><i>Task group: okbuck<i> + Generates IDEA module files (IML)<p><i>Task group: other<i> + Processes JVM resources 'main:resources'.<p><i>Task group: other<i> + Apply updates to a preexisting lock file and write to build/<specified name><p><i>Task group: Locking<i> + <i>Task group: other<i> + <i>Task group: other<i> + Cleans IDEA project files (IML, IPR)<p><i>Task group: IDE<i> + <i>Task group: other<i> + Generates an IDEA workspace file (IWS)<p><i>Task group: other<i> + Runs the unit tests.<p><i>Task group: verification<i> + Compiles Java source 'main:java'.<p><i>Task group: other<i> + Create a lock file in build/<configured name><p><i>Task group: Locking<i> + Runs all checks.<p><i>Task group: verification<i> + Generate BUCK files<p><i>Task group: okbuck<i> + Assembles the outputs of this project.<p><i>Task group: build<i> + Deletes the build directory.<p><i>Task group: build<i> + Compiles Java source 'test:java'.<p><i>Task group: other<i> + <i>Task group: other<i> + Installs the project as a JVM application along with libs and OS specific scripts.<p><i>Task group: application<i> + <i>Task group: other<i> + Processes JVM resources 'test:resources'.<p><i>Task group: other<i> + Assembles and tests this project.<p><i>Task group: build<i> + Create a lock file in build/<configured name><p><i>Task group: Locking<i> + Assembles and tests this project and all projects it depends on.<p><i>Task group: build<i> + Bundles the project as a JVM application with libs and OS specific scripts.<p><i>Task group: application<i> + Generates IDEA project file (IPR)<p><i>Task group: other<i> + Move the generated lock file into the project directory<p><i>Task group: Locking<i> + Bundles the project as a JVM application with libs and OS specific scripts.<p><i>Task group: application<i> + <i>Task group: other<i> + Configuration for archive artifacts. + Compile classpath for source set 'main'. + Configuration for default artifacts. + + Runtime classpath for source set 'main'. + Compile classpath for source set 'test'. + Runtime classpath for source set 'test'. + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + localhost + 5050 + + + + + + + + + + + 1491013016028 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/META-INF/persistence.xml b/src/META-INF/persistence.xml new file mode 100644 index 0000000..62dd562 --- /dev/null +++ b/src/META-INF/persistence.xml @@ -0,0 +1,47 @@ + + + + + + + org.eclipse.persistence.jpa.PersistenceProvider + + true + + + + + + + + + + + + + + + + + + org.eclipse.persistence.jpa.PersistenceProvider + true + + + + + + + + + + + + + + + diff --git a/src/main/java/com/example/farsite/Main.java b/src/main/java/com/example/farsite/Main.java new file mode 100644 index 0000000..8813d73 --- /dev/null +++ b/src/main/java/com/example/farsite/Main.java @@ -0,0 +1,36 @@ +package com.example.farsite; + +import com.example.farsite.model.Todo; + +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; +import java.util.List; + +public class Main { + private static final String PERSISTENCE_UNIT_NAME = "todos"; + private static EntityManagerFactory factory; + + public static void main(String[] args) { + factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME); + EntityManager em = factory.createEntityManager(); + // read the existing entries and write to console + Query q = em.createQuery("select t from Todo t"); + List todoList = q.getResultList(); + for (Todo todo : todoList) { + System.out.println(todo); + } + System.out.println("Size: " + todoList.size()); + + // create new todo + em.getTransaction().begin(); + Todo todo = new Todo(); + todo.setSummary("This is a test"); + todo.setDescription("This is a test"); + em.persist(todo); + em.getTransaction().commit(); + + em.close(); + } +} diff --git a/src/main/java/com/example/farsite/model/Family.java b/src/main/java/com/example/farsite/model/Family.java new file mode 100644 index 0000000..e8749a1 --- /dev/null +++ b/src/main/java/com/example/farsite/model/Family.java @@ -0,0 +1,19 @@ +package com.example.farsite.model; + +import lombok.Data; + +import javax.persistence.*; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Data +public class Family { + @Id + @GeneratedValue(strategy = GenerationType.TABLE) + private int id; + private String description; + + @OneToMany(mappedBy = "family") + private final List members = new ArrayList(); +} diff --git a/src/main/java/com/example/farsite/model/Job.java b/src/main/java/com/example/farsite/model/Job.java new file mode 100644 index 0000000..f09fbb6 --- /dev/null +++ b/src/main/java/com/example/farsite/model/Job.java @@ -0,0 +1,16 @@ +package com.example.farsite.model; +import lombok.Data; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +@Entity +public class Job { + @Id + @GeneratedValue(strategy = GenerationType.TABLE) + private int id; + private double salery; + private String jobDescr; +} diff --git a/src/main/java/com/example/farsite/model/Person.java b/src/main/java/com/example/farsite/model/Person.java new file mode 100644 index 0000000..f3b34cd --- /dev/null +++ b/src/main/java/com/example/farsite/model/Person.java @@ -0,0 +1,32 @@ +package com.example.farsite.model; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Transient; + +@Entity +@Data +public class Person { + @Id + @GeneratedValue(strategy = GenerationType.TABLE) + private String id; + private String firstName; + private String lastName; + + @ManyToOne + private Family family; + + @Transient + private String nonsenseField = ""; + + @OneToMany + private List jobList = new ArrayList(); +} diff --git a/src/main/java/com/example/farsite/model/Todo.java b/src/main/java/com/example/farsite/model/Todo.java new file mode 100644 index 0000000..20f0353 --- /dev/null +++ b/src/main/java/com/example/farsite/model/Todo.java @@ -0,0 +1,18 @@ +package com.example.farsite.model; + +import lombok.Data; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +@Entity +@Data +public class Todo { + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + private String summary; + private String description; +} diff --git a/src/test/java/com/example/farsite/model/JpaTest.java b/src/test/java/com/example/farsite/model/JpaTest.java new file mode 100644 index 0000000..5e6f17d --- /dev/null +++ b/src/test/java/com/example/farsite/model/JpaTest.java @@ -0,0 +1,107 @@ +package com.example.farsite.model; + +import org.junit.Before; +import org.junit.Test; + +import javax.persistence.EntityManager; +import javax.persistence.EntityManagerFactory; +import javax.persistence.Persistence; +import javax.persistence.Query; + +import static org.junit.Assert.assertTrue; + +public class JpaTest { + + private static final String PERSISTENCE_UNIT_NAME = "people"; + private EntityManagerFactory factory; + + @Before + public void setUp() throws Exception { + factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME); + EntityManager em = factory.createEntityManager(); + + // Begin a new local transaction so that we can persist a new entity + em.getTransaction().begin(); + + // read the existing entries + Query q = em.createQuery("select m from Person m"); + // Persons should be empty + + // do we have entries? + boolean createNewEntries = (q.getResultList().size() == 0); + + // No, so lets create new entries + if (createNewEntries) { + assertTrue(q.getResultList().size() == 0); + Family family = new Family(); + family.setDescription("Family for the Knopfs"); + em.persist(family); + for (int i = 0; i < 40; i++) { + Person person = new Person(); + person.setFirstName("Jim_" + i); + person.setLastName("Knopf_" + i); + em.persist(person); + // now persists the family person relationship + family.getMembers().add(person); + em.persist(person); + em.persist(family); + } + } + + // Commit the transaction, which will cause the entity to + // be stored in the database + em.getTransaction().commit(); + + // It is always good practice to close the EntityManager so that + // resources are conserved. + em.close(); + + } + + @Test + public void checkAvailablePeople() { + + // now lets check the database and see if the created entries are there + // create a fresh, new EntityManager + EntityManager em = factory.createEntityManager(); + + // Perform a simple query for all the Message entities + Query q = em.createQuery("select m from Person m"); + + // We should have 40 Persons in the database + assertTrue(q.getResultList().size() == 40); + + em.close(); + } + + @Test + public void checkFamily() { + EntityManager em = factory.createEntityManager(); + // Go through each of the entities and print out each of their + // messages, as well as the date on which it was created + Query q = em.createQuery("select f from Family f"); + + // We should have one family with 40 persons + assertTrue(q.getResultList().size() == 1); + assertTrue(((Family) q.getSingleResult()).getMembers().size() == 40); + em.close(); + } + + @Test(expected = javax.persistence.NoResultException.class) + public void deletePerson() { + EntityManager em = factory.createEntityManager(); + // Begin a new local transaction so that we can persist a new entity + em.getTransaction().begin(); + Query q = em + .createQuery("SELECT p FROM Person p WHERE p.firstName = :firstName AND p.lastName = :lastName"); + q.setParameter("firstName", "Jim_1"); + q.setParameter("lastName", "Knopf_!"); + Person user = (Person) q.getSingleResult(); + em.remove(user); + em.getTransaction().commit(); + Person person = (Person) q.getSingleResult(); + // Begin a new local transaction so that we can persist a new entity + + em.close(); + } +}