From: Mark D. <ma...@ta...> - 2002-09-19 09:54:06
|
Just added data accessor methods to sysmod. These are only created when a property called "jndiname" is defined. A static method findByID( int ID ) is made which looks up the id and uses the existing fillFromResultSet. And for each property who has the searchable attribute set to "yes", a findFirstBy{property} (returns the entity) and findBy{property} (returns a List of entitys). And thinking of also adding a findByQuery() which takes a where clause, and an interface to set the statement for nice flexability, used something like: String whereClause = "active = true and created > ?"; List accountList = Account.findByQuery( whereClause, new PreparedStatementSetter() { public void setPreparedStatement( PreparedStatement ps ) { ps.setDate(1, new Date()); } } Thoughts? -- \m/ -- "...if I seem super human I have been misunderstood." (c) Dream Theater ma...@ta... - ICQ: 1934853 JID: ta...@my... |