-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModel.java
More file actions
executable file
·71 lines (64 loc) · 1.89 KB
/
Model.java
File metadata and controls
executable file
·71 lines (64 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* 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.chk.restoadm.m;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.TypedQuery;
/**
*
* @author archey
*/
public abstract class Model implements Serializable{
// /**
// *
// * @param c Class is the table to take data from
// * @return
// */
// public static ArrayList<Model> findAll(Class c){
// String className = c.getSimpleName();
// ArrayList<Model> toReturn = new ArrayList<Model>();
// // code
// EntityManager em = Model.openInstance();
// String query = "SELECT t FROM " + className + " as t";
// TypedQuery<Model> req = em.createQuery(query, c);
//
// List<Model> allMod = req.getResultList();
//// Model.closeInstance(em);
// return toReturn;
// }
//
// public static EntityManager openTransaction(){
// EntityManager em = PersistenceManager.INSTANCE.getEntityManager();
// em.getTransaction().begin();
// return em;
// }
// public static EntityManager openInstance(){
// return PersistenceManager.INSTANCE.getEntityManager();
// }
// public static void closeInstance(EntityManager em){
// em.close();
// PersistenceManager.INSTANCE.close();
// }
/**
* <h1>Needs to be override</h1>
*/
private long id;
/**
* <h1>Needs to be override</h1>
* @return
*/
public abstract long getId();
/**
* <h1>Needs to be override</h1>
* @param id
*/
public abstract void setId(long id) ;
}