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"?> | |
<project | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | |
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<artifactId>rest-tutorial</artifactId> | |
<groupId>bahadirakin-tutorial</groupId> | |
<version>1.0.0.1-SNAPSHOT</version> | |
</parent> |
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.bahadirakin.model; | |
// Generated 06.Eki.2012 16:08:28 by Hibernate Tools 3.4.0.CR1 | |
import javax.persistence.Column; | |
import javax.persistence.Entity; | |
import javax.persistence.FetchType; | |
import javax.persistence.GeneratedValue; | |
import static javax.persistence.GenerationType.IDENTITY; | |
import javax.persistence.Id; |
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.bahadirakin.model; | |
// Generated 06.Eki.2012 16:08:28 by Hibernate Tools 3.4.0.CR1 | |
import java.util.HashSet; | |
import java.util.Set; | |
import javax.persistence.Column; | |
import javax.persistence.Entity; | |
import javax.persistence.FetchType; | |
import javax.persistence.GeneratedValue; |
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 hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" | |
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> | |
<hibernate-configuration> | |
<session-factory> | |
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> | |
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/dbrest?useUnicode=true&characterEncoding=UTF-8</property> | |
<property name="hibernate.default_schema">dbrest</property> | |
<property name="hibernate.connection.username">root</property> | |
<property name="hibernate.connection.password"></property> |
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
<dependency> | |
<groupId>org.apache.commons</groupId> | |
<artifactId>commons-lang3</artifactId> | |
<version>3.1</version> | |
</dependency> |
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.bahadirakin.model; | |
import java.io.Serializable; | |
public interface IEntity extends Serializable, Cloneable, Comparable<IEntity> { | |
public Integer getId(); | |
public void setId(Integer id); |
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.bahadirakin.model; | |
import java.io.Serializable; | |
import java.util.Comparator; | |
import org.apache.commons.lang3.builder.CompareToBuilder; | |
import org.apache.commons.lang3.builder.EqualsBuilder; | |
import org.apache.commons.lang3.builder.HashCodeBuilder; | |
public abstract class AbstractEntity implements IEntity { |
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.bahadirakin.util; | |
import org.hibernate.Session; | |
import org.hibernate.SessionFactory; | |
import org.hibernate.cfg.AnnotationConfiguration; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
public class HibernateUtil { |
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.bahadirakin.dao; | |
import java.io.Serializable; | |
import java.util.List; | |
import com.bahadirakin.model.IEntity; | |
public interface IBaseDAO<T extends IEntity> extends Serializable { | |
public Serializable save(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
package com.bahadirakin.dao.impl; | |
import java.io.Serializable; | |
import java.lang.reflect.ParameterizedType; | |
import java.util.List; | |
import org.hibernate.Criteria; | |
import org.hibernate.HibernateException; | |
import org.hibernate.Session; | |
import org.hibernate.Transaction; |