Skip to content
Snippets Groups Projects
Select Git revision
  • 0cdf29167abfb312d06765db450ea92ff7e164c7
  • master default
2 results

MyEntityDao.java

Blame
  • Forked from Nils Tesdal / idatt1002
    Source project has a limited visibility.
    MyEntityDao.java 954 B
    package myapp.dao;
    
    import myapp.data.MyEntity;
    
    import java.util.Arrays;
    import java.util.List;
    
    /**
     * DataAccessObject for the MyEntity-entity
     *
     * @author nilstes
     */
    public class MyEntityDao {
    
        /**
         * Get object with given id
         *
         * @param  id  the entity id
         * @return     an instance of MyEntity
         */
        public MyEntity getMyEntity(String id) {
    		// Get connection (maybe use pool?)
    		// Do some SQL
    		// Return som real data
    		
    		return new MyEntity("id", "name");
        }
    
        public List<MyEntity> findMyEntities(String someParameter) {
    		// Get connection (maybe use pool?)
    		// Do some SQL
    		// Return som real data
    		
    		return Arrays.asList(new MyEntity("id1", "name1"), new MyEntity("id2", "name2"));
        }
    	
    	public void addMyEntity(MyEntity obj) {
    		// Get connection (maybe use pool?)
    		// Do some SQL
        }
    	
    	public void deleteMyEntity(String id) {
    		// Get connection (maybe use pool?)
    		// Do some SQL
        }
     }