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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>New Employee</title> | |
</head> | |
<body> | |
Employee created with success! | |
${emp} | |
</body> |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>::StaffGest:: - search-employee</title> | |
<meta name="description" content="StaffGest:: - search-employee"> | |
<meta name="author" content="Arthur Portas"> | |
</head> | |
<body> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Search Employee</title> | |
</head> | |
<body> | |
Search results: ${emp} | |
</body> | |
</html> |
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
package unittests; | |
import com.arthurportas.persistence.daos.EmployeeDaoImpl; | |
import com.arthurportas.persistence.entities.Employee; | |
import com.github.javafaker.Faker; | |
import org.apache.commons.lang3.StringUtils; | |
import org.junit.Assert; | |
import org.junit.Before; | |
import org.junit.Test; |
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
package com.arthurportas.persistence.daos; | |
import com.arthurportas.persistence.entities.Employee; | |
import java.util.List; | |
/** | |
* Created by arthurportas on 10/05/2017. | |
*/ | |
public class EmployeeDaoImpl extends GenericDaoImpl<Employee> implements EmployeeDaoCustom<Employee> { |
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
package com.arthurportas.persistence.daos; | |
import java.util.List; | |
/** | |
* Created by arthurportas on 10/05/2017. | |
*/ | |
public interface EmployeeDaoCustom<Employee> { | |
List<Employee> findByName(String pattern); |
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
package com.arthurportas.persistence.daos; | |
import com.arthurportas.persistence.PersistenceEnum; | |
import javax.persistence.EntityManager; | |
import javax.persistence.Persistence; | |
/** | |
* Created by arthurportas on 14/05/2017. | |
*/ |
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
package com.arthurportas.persistence.daos; | |
/** | |
* Created by arthurportas on 10/05/2017. | |
*/ | |
public interface GenericDao<T> { | |
T save(T entity); | |
void delete(T entity); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence version="2.0" | |
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> | |
<persistence-unit name="jpa-example" transaction-type="RESOURCE_LOCAL"> | |
<!-- Persistence provider --> | |
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> | |
<!-- Entity classes --> | |
<class>com.arthurportas.persistence.entities.Employee</class> | |
<properties> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:f="http://java.sun.com/jsf/core" | |
xmlns:h="http://java.sun.com/jsf/html"> | |
<head> | |
<title>::StaffGest:: - search-employee</title> | |
</head> |