This repository has been archived by the owner on Jul 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
anordin
committed
Oct 17, 2012
1 parent
28dae65
commit 3618628
Showing
12 changed files
with
206 additions
and
215 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scene Scope="Project" version="2"> | ||
<Scope Scope="Faces Configuration Only"/> | ||
<Scope Scope="Project"/> | ||
<Scope Scope="All Faces Configurations"/> | ||
</Scene> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scene Scope="Project" version="2"> | ||
<Scope Scope="Faces Configuration Only"/> | ||
<Scope Scope="Project"/> | ||
<Scope Scope="All Faces Configurations"/> | ||
</Scene> |
4 changes: 0 additions & 4 deletions
4
src/main/java/dat076/frukostklubben/bb/CustomerController.java
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/main/java/dat076/frukostklubben/ejb/CustomerEJBRemote.java
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package dat076.frukostklubben.ejb; | ||
|
||
import dat076.frukostklubben.model.User; | ||
import java.util.List; | ||
import javax.ejb.LocalBean; | ||
import javax.ejb.Stateless; | ||
import javax.persistence.EntityManager; | ||
import javax.persistence.PersistenceContext; | ||
import javax.persistence.TypedQuery; | ||
|
||
/** | ||
* | ||
* @author freein | ||
* Edited by: Anders, 2012-10-17 | ||
*/ | ||
@Stateless | ||
@LocalBean | ||
public class UserEJB implements UserEJBRemote { | ||
|
||
@PersistenceContext(unitName = "projectPU") | ||
private EntityManager em; | ||
|
||
@Override | ||
public List<User> findUsers() { | ||
TypedQuery<User> query = em.createNamedQuery("findAllUsers", User.class); | ||
return query.getResultList(); | ||
} | ||
|
||
@Override | ||
public User findUserById(Long id) { | ||
return em.find(User.class, id); | ||
} | ||
|
||
@Override | ||
public User createUser(User user) { | ||
em.persist(user); | ||
return user; | ||
} | ||
|
||
@Override | ||
public void deleteUser(User user) { | ||
em.remove(em.merge(user)); | ||
} | ||
|
||
@Override | ||
public User updateUser(User user) { | ||
return em.merge(user); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/dat076/frukostklubben/ejb/UserEJBRemote.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package dat076.frukostklubben.ejb; | ||
|
||
import dat076.frukostklubben.model.User; | ||
import java.util.List; | ||
import javax.ejb.Remote; | ||
|
||
/** | ||
* | ||
* @author freein | ||
* Edited by: Anders, 2012-10-17 | ||
*/ | ||
@Remote | ||
public interface UserEJBRemote { | ||
List<User> findUsers(); | ||
User findUserById(Long id); | ||
User createUser(User customer); | ||
void deleteUser(User customer); | ||
User updateUser(User customer); | ||
} |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.