| Line 7... |
Line 7... |
| 7 |
import javax.persistence.Convert;
|
7 |
import javax.persistence.Convert;
|
| 8 |
import javax.persistence.Entity;
|
8 |
import javax.persistence.Entity;
|
| 9 |
import javax.persistence.GeneratedValue;
|
9 |
import javax.persistence.GeneratedValue;
|
| 10 |
import javax.persistence.GenerationType;
|
10 |
import javax.persistence.GenerationType;
|
| 11 |
import javax.persistence.Id;
|
11 |
import javax.persistence.Id;
|
| 12 |
import javax.persistence.NamedQueries;
|
- |
|
| 13 |
import javax.persistence.NamedQuery;
|
- |
|
| 14 |
import javax.persistence.Table;
|
12 |
import javax.persistence.Table;
|
| 15 |
import javax.persistence.UniqueConstraint;
|
13 |
import javax.persistence.UniqueConstraint;
|
| 16 |
|
14 |
|
| 17 |
import org.hibernate.annotations.UpdateTimestamp;
|
15 |
import org.hibernate.annotations.UpdateTimestamp;
|
| 18 |
|
16 |
|
| Line 25... |
Line 23... |
| 25 |
* @author ashikali
|
23 |
* @author ashikali
|
| 26 |
*
|
24 |
*
|
| 27 |
*/
|
25 |
*/
|
| 28 |
@Entity
|
26 |
@Entity
|
| 29 |
@Table(name="dtr.api", schema = "dtr", uniqueConstraints = {@UniqueConstraint(columnNames = {"uri","method"})})
|
27 |
@Table(name="dtr.api", schema = "dtr", uniqueConstraints = {@UniqueConstraint(columnNames = {"uri","method"})})
|
| 30 |
@NamedQueries({
|
- |
|
| 31 |
@NamedQuery(name = "Api.selectCount", query = "select count(a) from Api a"),
|
- |
|
| 32 |
@NamedQuery(name="Api.selectAll",query="select a from Api a"),
|
- |
|
| 33 |
@NamedQuery(name="Api.selectById",query="select a from Api a where a.id= :id"),
|
- |
|
| 34 |
@NamedQuery(name="Api.selectByName",query="select a from Api a where a.name= :name"),
|
- |
|
| 35 |
@NamedQuery(name="Api.selectByUri",query="select a from Api a where a.uri= :uri"),
|
- |
|
| 36 |
@NamedQuery(name="Api.selectUniqueCount",query="select count(a) from Api a where a.uri = :uri and a.method = :method"),
|
- |
|
| 37 |
@NamedQuery(name="Api.selectNameCount",query="select count(a) from Api a where a.name = :name"),
|
- |
|
| 38 |
@NamedQuery(name="Api.deleteById",query="delete from Api a where a.id= :id"),
|
- |
|
| 39 |
@NamedQuery(name = "Api.updateById", query = "update Api a set a.name = :name, a.uri = :uri, a.method = :method, a.updateTimestamp = :updateTimestamp where a.id = :id"),
|
- |
|
| 40 |
})
|
- |
|
| 41 |
public class Api implements Serializable{
|
28 |
public class Api implements Serializable{
|
| 42 |
|
29 |
|
| 43 |
private static final long serialVersionUID = 1L;
|
30 |
private static final long serialVersionUID = 1L;
|
| 44 |
|
31 |
|
| 45 |
public Api() {
|
32 |
public Api() {
|