-
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
Showing
10 changed files
with
354 additions
and
399 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
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
42 changes: 42 additions & 0 deletions
42
balldraw_core/src/main/java/com/nunoaac/balldraw_core/balldraw/domain/daos/ClientJpaDAO.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,42 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package com.nunoaac.balldraw_core.balldraw.domain.daos; | ||
|
||
import com.nunoaac.balldraw_core.balldraw.domain.beans.Client; | ||
import com.nunoaac.balldraw_core.balldraw.domain.daos.exceptions.NonexistentEntityException; | ||
import com.nunoaac.balldraw_core.balldraw.domain.daos.exceptions.PreexistingEntityException; | ||
import java.io.Serializable; | ||
import java.util.List; | ||
import javax.persistence.EntityManager; | ||
import javax.persistence.EntityManagerFactory; | ||
import javax.persistence.Query; | ||
import javax.persistence.EntityNotFoundException; | ||
import javax.persistence.NoResultException; | ||
import javax.persistence.TypedQuery; | ||
import javax.persistence.criteria.CriteriaBuilder; | ||
import javax.persistence.criteria.CriteriaQuery; | ||
import javax.persistence.criteria.ParameterExpression; | ||
import javax.persistence.criteria.Root; | ||
|
||
/** | ||
* | ||
* @author nunocosta | ||
*/ | ||
public class ClientJpaDAO extends GenericDAO implements Serializable { | ||
|
||
public ClientJpaDAO() { | ||
super(Client.class); | ||
} | ||
|
||
public String getHashPasswordForClient (String username) throws NoResultException { | ||
|
||
Query q3 = getEntityManager().createQuery("SELECT c.hashPassword FROM Client c WHERE c.username = :userParam", Client.class); | ||
q3.setParameter("userParam", username); | ||
String password = (String)q3.getSingleResult(); | ||
|
||
return password; | ||
} | ||
} |
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.