Skip to content

Commit aeb14ce

Browse files
author
Jared Nagle
committed
created some users and stuff
1 parent 6a6decb commit aeb14ce

File tree

12 files changed

+108
-18
lines changed

12 files changed

+108
-18
lines changed

.idea/compiler.xml

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

.idea/dataSources.xml

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

.idea/dictionaries/Jared_Nagle.xml

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

.idea/sqldialects.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.thenaglecode.core.security.ejb;
2+
3+
import com.thenaglecode.core.security.entities.User;
4+
5+
import javax.ejb.LocalBean;
6+
import javax.ejb.Stateless;
7+
import javax.persistence.EntityManager;
8+
import javax.persistence.PersistenceContext;
9+
10+
/**
11+
* Created with IntelliJ IDEA.
12+
* User: Jared Nagle
13+
* Date: 14/08/13
14+
* Time: 9:59 PM
15+
*/
16+
@Stateless(name = "SecurityProcessorEJB")
17+
@LocalBean
18+
public class SecurityProcessorBean {
19+
20+
@PersistenceContext
21+
private EntityManager em;
22+
23+
public SecurityProcessorBean() {
24+
}
25+
26+
public User createUser(String username){
27+
User user = new User(username);
28+
em.persist(user);
29+
return user;
30+
}
31+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.thenaglecode.core.security.entities;
2+
3+
import javax.persistence.*;
4+
import javax.validation.constraints.NotNull;
5+
6+
/**
7+
* Created with IntelliJ IDEA.
8+
* User: Jared Nagle
9+
* Date: 14/08/13
10+
* Time: 9:08 PM
11+
*/
12+
13+
@Entity
14+
@Table(name = "COGROUP")
15+
public class Group {
16+
17+
@Id
18+
@GeneratedValue(strategy = GenerationType.TABLE)
19+
@NotNull
20+
long id;
21+
22+
String name;
23+
}

src/main/java/com/thenaglecode/core/security/entities/User.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package com.thenaglecode.core.security.entities;
22

3-
import javax.persistence.Entity;
4-
import javax.persistence.GeneratedValue;
5-
import javax.persistence.GenerationType;
6-
import javax.persistence.Id;
3+
import javax.persistence.*;
4+
import javax.validation.constraints.NotNull;
75
import java.security.Principal;
86

97
/**
@@ -14,15 +12,23 @@
1412
*/
1513

1614
@Entity
15+
@Table(name = "COUSER")
1716
public class User implements Principal {
1817

1918
@Id
20-
@GeneratedValue(strategy = GenerationType.AUTO)
19+
@GeneratedValue(strategy = GenerationType.TABLE)
20+
@Column(name = "USERID")
2121
long id;
2222

23+
@NotNull
2324
String username;
2425
String password;
2526

27+
@ManyToMany
28+
@JoinTable(
29+
name = ""
30+
)
31+
2632
/**
2733
* Getter for id
2834
* @return the user's unique database identifier
@@ -59,4 +65,8 @@ public String getUsername() {
5965
public String getName() {
6066
return getUsername();
6167
}
68+
69+
public User(String username){
70+
this.username = username;
71+
}
6272
}

src/main/java/com/thenaglecode/jsf/MainUIController.java renamed to src/main/java/com/thenaglecode/jsf/controllers/MainUIController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.thenaglecode.jsf;
1+
package com.thenaglecode.jsf.controllers;
22

33
import javax.faces.bean.ManagedBean;
44

src/main/java/com/thenaglecode/jsf/NavigationController.java renamed to src/main/java/com/thenaglecode/jsf/controllers/NavigationController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.thenaglecode.jsf;
1+
package com.thenaglecode.jsf.controllers;
22

33
import javax.faces.bean.ManagedBean;
44

src/main/java/com/thenaglecode/jsf/RandomGeneratorController.java renamed to src/main/java/com/thenaglecode/jsf/controllers/RandomGeneratorController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.thenaglecode.jsf;
1+
package com.thenaglecode.jsf.controllers;
22

33
import com.thenaglecode.algorithms.ejb.session.singletons.AlgorithmControllerBean;
44

src/main/java/com/thenaglecode/jsf/URLController.java renamed to src/main/java/com/thenaglecode/jsf/controllers/URLController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.thenaglecode.jsf;
1+
package com.thenaglecode.jsf.controllers;
22

33
/**
44
* Created with IntelliJ IDEA.

src/main/resources/com/thenaglecode/core/configuration.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
default.base.package=com.thenaglecode
33
default.configuration.filename=configuration
44
configuration.filenames=configuration,coreUI
5-
database.url=http://localhost:
6-
database.jndi=jndi/AlgorithmsDS
5+
database.jndi=jndi/PlayGDS

0 commit comments

Comments
 (0)