Skip to content

Commit 3358d36

Browse files
author
=
committed
database stuff
1 parent aeb14ce commit 3358d36

File tree

7 files changed

+2037
-5
lines changed

7 files changed

+2037
-5
lines changed

.idea/dataSources.ids

Lines changed: 1984 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dataSources.xml

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/sqldialects.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Algorithms.iml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@
2626
</ejbRoots>
2727
</configuration>
2828
</facet>
29+
<facet type="jpa" name="JPA">
30+
<configuration>
31+
<setting name="validation-enabled" value="true" />
32+
<setting name="provider-name" value="" />
33+
<datasource-mapping />
34+
<deploymentDescriptor name="persistence.xml" url="file://$MODULE_DIR$/META-INF/persistence.xml" />
35+
</configuration>
36+
</facet>
2937
</component>
3038
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
3139
<output url="file://$MODULE_DIR$/target/classes" />

META-INF/persistence.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
3+
<persistence-unit name="AlgorithmsPU">
4+
<jta-data-source></jta-data-source>
5+
</persistence-unit>
6+
</persistence>

src/main/java/com/thenaglecode/algorithms/primes/PrimeList.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* User: jxnagl
1010
* Date: 7/29/13
1111
* Time: 4:38 PM
12-
* To change this template use File | Settings | File Templates.
1312
*/
1413
public class PrimeList implements Serializable, Iterable<Long> {
1514

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
CREATE SCHEMA PLAYG;
2+
3+
drop table couser;
4+
drop table cogroup;
5+
drop table cogroupuserlink;
6+
7+
CREATE TABLE COUSER (
8+
USERID BIGINT UNSIGNED NOT NULL UNIQUE PRIMARY KEY,
9+
USERNAME VARCHAR(128) NOT NULL UNIQUE,
10+
PASSWORD CHAR(128)
11+
);
12+
13+
CREATE TABLE COGROUP (
14+
GROUPID BIGINT UNSIGNED NOT NULL UNIQUE PRIMARY KEY,
15+
NAME VARCHAR(64)
16+
);
17+
18+
-- links a user to a group
19+
CREATE TABLE COGROUPUSERLINK (
20+
USERID BIGINT UNSIGNED NOT NULL
21+
REFERENCES COUSER (USERID),
22+
GROUPID BIGINT UNSIGNED NOT NULL
23+
REFERENCES COGROUP (GROUPID),
24+
PRIMARY KEY (USERID, GROUPID) -- to ensure no duplicates
25+
);
26+
27+
-- this table will be used to generate next numbers
28+
CREATE TABLE openjpa_sequence_table (
29+
ID tinyint(4) NOT NULL,
30+
SEQUENCE_VALUE bigint(20) default NULL,
31+
PRIMARY KEY (ID)
32+
);

0 commit comments

Comments
 (0)