Changeset 29 for trunk/fmgVen/src/com/fmguler
- Timestamp:
- Feb 10, 2011, 10:06:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/fmgVen/src/com/fmguler/ven/Ven.java
r28 r29 45 45 } 46 46 47 public List list(Class objectClass) {48 return null;49 }50 51 47 public int count() { 52 48 return 0; 53 49 } 54 50 51 /** 52 * Get the object with the specified id, of the specified objectClass type. 53 * <p> 54 * By default none of the associations will be retrieved. 55 * To include the object associations (retrieve the object graph) joins should be specified, e.g. 56 * <code>SomeObject.anotherObject</code> 57 * 58 * @param id the id of the object to be retrieved 59 * @param objectClass the class of the object to be retrieved 60 * @param joins the set of object graphs to be included with the object 61 * @return the retrieved object including specified associations 62 */ 55 63 public Object get(int id, Class objectClass, Set joins) { 56 64 String query = generator.generateSelectQuery(objectClass, joins); … … 65 73 if (result.size() > 1) System.out.println("Ven - WARNING >> get(id) returns more than one row"); 66 74 return result.get(0); 75 } 76 77 /** 78 * List the objects of the specified objectClass type. 79 * <p> 80 * By default none of the associations will be retrieved. 81 * To include the object associations (retrieve the object graph) joins should be specified, e.g. 82 * <code>SomeObject.anotherObject</code> 83 * 84 * @param objectClass the class of the objects to be retrieved 85 * @param joins the set of object graphs to be included with objects 86 * @return the list of objects including specified associations 87 */ 88 public List list(Class objectClass, Set joins) { 89 String query = generator.generateSelectQuery(objectClass, joins); 90 91 Map paramMap = new HashMap(); 92 if (debug) System.out.println("Ven - SQL: " + query); 93 94 List result = mapper.list(query, paramMap, objectClass); 95 return result; 67 96 } 68 97 … … 124 153 //-------------------------------------------------------------------------- 125 154 //SETTERS 155 /** 156 * Set the DataSource to be used to access to the database 157 */ 126 158 public void setDataSource(DataSource dataSource) { 127 159 if (dataSource == null) throw new RuntimeException("fmgVen - DataSource cannot be null"); … … 130 162 } 131 163 164 /** 165 * Add the domain packages that have corresponding database tables. 166 * <p> 167 * The objects in these packages are considered persistable. 168 * @param domainPackage the package of the entity classes. 169 * @return this instance to allow chaining. 170 */ 132 171 public Ven addDomainPackage(String domainPackage) { 133 172 generator.addDomainPackage(domainPackage);
Note: See TracChangeset
for help on using the changeset viewer.