tailieunhanh - Apress bắt đầu ứng dụng với java google - p 19

CHAPTER 7 ■ USING THE APP ENGINE DATASTORE @SuppressWarnings("serial") public class DataServiceImpl extends RemoteServiceServlet implements DataService { private static final Logger LOG = (()); private static final PersistenceManagerFactory PMF = ("transactions-optional"); public String addEntries(Vector entries) throws NotLoggedInException { // ensure that the current user is logged in checkLoggedIn(); PersistenceManager pm = getPersistenceManager(); try { (toEntities(entries)); } finally { (); } (, ()+" entries added."); return ()+" entries added."; } public Vector getEntries() throws NotLoggedInException { // ensure that the current user is logged in checkLoggedIn(); Vector entries = new Vector(); PersistenceManager pm = getPersistenceManager(); try { String query =. | CHAPTER 7 USING THE APP ENGINE DATASTORE @SuppressWarnings serial public class DataServiceImpl extends RemoteServiceServlet implements DataService private static final Logger LOG private static final PersistenceManagerFactory PMF transactions-optional public String addEntries Vector TimeEntryData entries throws NotLoggedInException ensure that the current user is logged in checkLoggedIn PersistenceManager pm getPersistenceManager try toEntities entries finally entries added. return entries added. public Vector TimeEntryData getEntries throws NotLoggedInException ensure that the current user is logged in checkLoggedIn Vector TimeEntryData entries new Vector TimeEntryData PersistenceManager pm getPe rsistenceManager try String query select from where email getUser .getEmail order by date desc List TimeEntryEntity entities List TimeEntryEntity query .execute 158 CHAPTER 7 USING THE APP ENGINE DATASTORE for TimeEntryEntity entity entities TimeEntryData ted new TimeEntryData ted finally return entries returns a simple String Array of project names public String getProjects String projects new String 3 projects 0 Project 1 projects 1 Project 2 projects Project 3 return projects returns a simple String Array of milestone name for a project public String getMilestones String project String milestones new String 3 if Project 1 milestones 0 Milestone 1-1 milestones 1 Milestone 1-2 milestones 2 Mile stone 1-3 else if Project 2 milestones 0 Mile stone 2-1 milestones 1 Mile stone 2-2 milestones 2 Mile stone 2-3 159 CHAPTER 7 USING THE APP ENGINE DATASTORE else milestones

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.