-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from carlosvasquez/master
merge de nuevos cambios para el manejo de información de universidades
- Loading branch information
Showing
3 changed files
with
175 additions
and
5 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
118 changes: 118 additions & 0 deletions
118
src/main/java/org/devdom/fbclient/model/dto/University.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,118 @@ | ||
/* | ||
* 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 org.devdom.fbclient.model.dto; | ||
|
||
import java.io.Serializable; | ||
import javax.persistence.Basic; | ||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.NamedQueries; | ||
import javax.persistence.NamedQuery; | ||
import javax.persistence.Table; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
|
||
/** | ||
* | ||
* @author Ronny Placencia | ||
*/ | ||
@Entity | ||
@Table(name = "dev_university") | ||
@XmlRootElement | ||
@NamedQueries({ | ||
@NamedQuery(name = "University.findAll", query = "SELECT u FROM University u"), | ||
@NamedQuery(name = "University.findById", query = "SELECT u FROM University u WHERE u.id = :id"), | ||
@NamedQuery(name = "University.findByFbId", query = "SELECT u FROM University u WHERE u.fbId = :fbId"), | ||
@NamedQuery(name = "University.findByName", query = "SELECT u FROM University u WHERE u.name = :name"), | ||
@NamedQuery(name = "University.findByVotes", query = "SELECT u FROM University u WHERE u.votes = :votes")}) | ||
public class University implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Basic(optional = false) | ||
@Column(name = "id") | ||
private Integer id; | ||
@Column(name = "fb_id") | ||
private long fbId; | ||
@Column(name = "name") | ||
private String name; | ||
@Column(name = "votes") | ||
private Short votes; | ||
|
||
public University() { | ||
} | ||
|
||
public University(long fbId, String name, Short votes){ | ||
this.fbId = fbId; | ||
this.name = name; | ||
this.votes = votes; | ||
} | ||
|
||
public University(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public Integer getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Integer id) { | ||
this.id = id; | ||
} | ||
|
||
public long getFbId() { | ||
return fbId; | ||
} | ||
|
||
public void setFbId(long fbId) { | ||
this.fbId = fbId; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Short getVotes() { | ||
return votes; | ||
} | ||
|
||
public void setVotes(Short votes) { | ||
this.votes = votes; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int hash = 0; | ||
hash += (id != null ? id.hashCode() : 0); | ||
return hash; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object object) { | ||
// TODO: Warning - this method won't work in the case the id fields are not set | ||
if (!(object instanceof University)) { | ||
return false; | ||
} | ||
University other = (University) object; | ||
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "org.devdom.fbclient.model.dto.University[ id=" + id + " ]"; | ||
} | ||
|
||
} |