T5DbDemo.java

Go to the documentation of this file.
00001 package cedar.hepdata.webapp.pages;
00002 
00003 import cedar.hepdata.model.*;
00004 import cedar.hepdata.xml.*;
00005 import cedar.hepdata.db.*;
00006 
00007 import org.apache.tapestry.annotations.*;
00008 
00009 import org.hibernate.*;
00010 import java.util.*;
00011 
00012 
00013 public class T5DbDemo {
00014 
00015     @Inject
00016     private Session _session;
00017 
00018     // Papers
00019     private Paper _paper;
00020     public Paper getPaper() { return _paper; }
00021     public void setPaper(Paper p) { _paper = p; }
00022 
00023     public List<Paper> getPapers() {
00024         Criteria c = _session.createCriteria(Paper.class);
00025         c.setMaxResults(2);
00026         return c.list();
00027     }
00028 
00029     // Datasets
00030     private Dataset _dataset;
00031     public Dataset getDataset() { return _dataset; }
00032     public void setDataset(Dataset d) { _dataset = d; }
00033 
00034     public SortedSet<Dataset> getDatasets() {
00035         return _paper.getDatasets();
00036     }
00037 
00038 }

Generated on Tue Apr 21 15:55:00 2009 for HepData Web servlets by  doxygen 1.5.5