You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(11) |
Oct
(10) |
Nov
(3) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(44) |
Feb
(30) |
Mar
(11) |
Apr
(43) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(9) |
Oct
|
Nov
(1) |
Dec
(1) |
2008 |
Jan
(1) |
Feb
|
Mar
|
Apr
(17) |
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <rfl...@us...> - 2007-04-24 18:56:56
|
Revision: 295 http://svn.sourceforge.net/salto-db/?rev=295&view=rev Author: rflament Date: 2007-04-24 11:56:54 -0700 (Tue, 24 Apr 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm Modified: salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm 2007-04-24 10:13:45 UTC (rev 294) +++ salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm 2007-04-24 18:56:54 UTC (rev 295) @@ -21,6 +21,8 @@ List<T> findAll(); List<T> findByCriteria(Map criterias); + + public List<T> findByExample(T exampleInstance, String[] excludeProperty); void save(T entity); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-24 10:13:47
|
Revision: 294 http://svn.sourceforge.net/salto-db/?rev=294&view=rev Author: rflament Date: 2007-04-24 03:13:45 -0700 (Tue, 24 Apr 2007) Log Message: ----------- remove unused imports Modified Paths: -------------- salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm Modified: salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm 2007-04-24 10:10:29 UTC (rev 293) +++ salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm 2007-04-24 10:13:45 UTC (rev 294) @@ -7,10 +7,8 @@ import java.util.Map; import org.hibernate.Criteria; -import org.hibernate.FlushMode; import org.hibernate.Query; import org.hibernate.LockMode; -import org.hibernate.Session; import org.hibernate.criterion.Restrictions; import org.hibernate.criterion.Criterion; import org.hibernate.criterion.Example; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-24 10:10:30
|
Revision: 293 http://svn.sourceforge.net/salto-db/?rev=293&view=rev Author: rflament Date: 2007-04-24 03:10:29 -0700 (Tue, 24 Apr 2007) Log Message: ----------- use hibernate criterias instead of HQl queries Modified Paths: -------------- salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm salto-db-generator/trunk/templates/hibernateejb3dao/common-abstracthibernatedao.vm salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm Modified: salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm 2007-04-23 17:18:16 UTC (rev 292) +++ salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm 2007-04-24 10:10:29 UTC (rev 293) @@ -4,12 +4,14 @@ import java.io.Serializable; import java.lang.reflect.ParameterizedType; import java.util.List; +import java.util.Map; import org.hibernate.Criteria; import org.hibernate.FlushMode; import org.hibernate.Query; import org.hibernate.LockMode; import org.hibernate.Session; +import org.hibernate.criterion.Restrictions; import org.hibernate.criterion.Criterion; import org.hibernate.criterion.Example; Modified: salto-db-generator/trunk/templates/hibernateejb3dao/common-abstracthibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/common-abstracthibernatedao.vm 2007-04-23 17:18:16 UTC (rev 292) +++ salto-db-generator/trunk/templates/hibernateejb3dao/common-abstracthibernatedao.vm 2007-04-24 10:10:29 UTC (rev 293) @@ -37,13 +37,10 @@ getSession().delete(entity); } - public void delete(T entity, Boolean doItNow) { - if (doItNow) { - getSession().setFlushMode(FlushMode.ALWAYS); - } - delete(entity); + public void deleteById(ID id) { + getSession().delete(loadById(id)); } - + @SuppressWarnings("unchecked") public List<T> findAll() { return findByCriteria(); @@ -60,7 +57,18 @@ } return crit.list(); } + + /** + * Find by criteria. + */ + @SuppressWarnings("unchecked") + public List<T> findByCriteria(Map criterias) { + Criteria criteria = getSession().createCriteria(getPersistentClass()); + criteria.add(Restrictions.allEq(criterias)); + return criteria.list(); + } + /** * This method will execute an HQL query and return the number of affected entities. */ Modified: salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm 2007-04-23 17:18:16 UTC (rev 292) +++ salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm 2007-04-24 10:10:29 UTC (rev 293) @@ -1,6 +1,5 @@ package ${jdoInfo.javaPckName}; -import java.util.Map; import java.util.List; import java.sql.Timestamp; @@ -34,13 +33,7 @@ * You might want to extend this interface and to change the dao factory to return * an instance of the new implemenation in build${jdoInfo.javaClassName}DAO() */ - - /** - * Find ${jdoInfo.javaClassName} by criteria. - */ - public List<${jdoInfo.javaClassName}> findByCriteria(Map criterias); - - + #if ($util.getLength($jdoInfo.getPk()) > 1) #foreach($col in ${jdoInfo.jdoColInfos}) /** Modified: salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm 2007-04-23 17:18:16 UTC (rev 292) +++ salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm 2007-04-24 10:10:29 UTC (rev 293) @@ -2,6 +2,7 @@ import java.io.Serializable; import java.util.List; +import java.util.Map; /** * Generated at $date @@ -18,6 +19,8 @@ T loadById(ID id); List<T> findAll(); + + List<T> findByCriteria(Map criterias); void save(T entity); @@ -26,8 +29,6 @@ void saveOrUpdate(T entity); void delete(T entity); - - void delete(T entity, Boolean doItNow); void deleteById(ID id); Modified: salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm 2007-04-23 17:18:16 UTC (rev 292) +++ salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm 2007-04-24 10:10:29 UTC (rev 293) @@ -1,6 +1,5 @@ package ${jdoInfo.javaPckName}.hibernate; -import java.util.Map; import java.util.List; import java.sql.Timestamp; @@ -10,8 +9,6 @@ import ${jdoInfo.javaPckName}.pojo.${jdoInfo.javaClassName}.${jdoInfo.javaClassName}PK; #end -import org.hibernate.Criteria; -import org.hibernate.Query; import org.hibernate.criterion.Restrictions; #set ($pk="Long") #foreach($col in ${jdoInfo.jdoColInfos}) @@ -35,22 +32,6 @@ public class ${jdoInfo.javaClassName}HibernateDAO extends AbstractHibernateDAO<${jdoInfo.javaClassName}, $pk> implements ${jdoInfo.javaClassName}DAO { - - /** - * Find ${jdoInfo.javaClassName} by criteria. - */ - @SuppressWarnings("unchecked") - public List<${jdoInfo.javaClassName}> findByCriteria(Map criterias) { - - Criteria criteria = getSession().createCriteria(${jdoInfo.javaClassName}.class); - criteria.add(Restrictions.allEq(criterias)); - return criteria.list(); - } - - public void deleteById($pk id) { - ${jdoInfo.javaClassName} $util.doNameCreator.class2attribute(${jdoInfo.javaClassName}) = loadById(id); - this.getSession().delete($util.doNameCreator.class2attribute(${jdoInfo.javaClassName})); - } #if ($util.getLength($jdoInfo.getPk()) > 1) #foreach($col in ${jdoInfo.jdoColInfos}) @@ -70,10 +51,7 @@ */ @SuppressWarnings("unchecked") public List<${jdoInfo.javaClassName}> findBy$util.doNameCreator.attribute2class($col.javaAttName)($col.getNonPrimitifClass() ${col.javaAttName}) { - Query q = getSession().createQuery("from ${jdoInfo.javaClassName} where $util.doNameCreator.class2attribute($util.doNameCreator.createDoName(${colfk2.getPkTableName()})).${col.javaAttName} = :${col.javaAttName}"); - q.setParameter("${col.javaAttName}",${col.javaAttName}); - q.setCacheable(true); - return q.list(); + return findByCriteria(Restrictions.eq("$util.doNameCreator.class2attribute($util.doNameCreator.createDoName(${colfk2.getPkTableName()})).${col.javaAttName}", ${col.javaAttName})); } #end @@ -83,12 +61,8 @@ /** * Find ${jdoInfo.javaClassName} by ${col.javaAttName} */ - @SuppressWarnings("unchecked") public List<${jdoInfo.javaClassName}> findBy$util.doNameCreator.attribute2class($col.javaAttName)($col.getNonPrimitifClass() ${col.javaAttName}) { - Query q = getSession().createQuery("from ${jdoInfo.javaClassName} where ${col.javaAttName} = :${col.javaAttName}"); - q.setParameter("${col.javaAttName}",${col.javaAttName}); - q.setCacheable(true); - return q.list(); + return findByCriteria(Restrictions.eq("${col.javaAttName}", ${col.javaAttName})); } #else @@ -96,12 +70,8 @@ /** * Find ${jdoInfo.javaClassName} by ${col.javaAttName} */ - @SuppressWarnings("unchecked") public List<${jdoInfo.javaClassName}> findBy$util.doNameCreator.attribute2class($col.javaAttName)($col.getNonPrimitifClass() ${col.javaAttName}) { - Query q = getSession().createQuery("from ${jdoInfo.javaClassName} where id.${col.javaAttName} = :${col.javaAttName}"); - q.setParameter("${col.javaAttName}",${col.javaAttName}); - q.setCacheable(true); - return q.list(); + return findByCriteria(Restrictions.eq("id.${col.javaAttName}", ${col.javaAttName})); } #end #end @@ -124,10 +94,7 @@ */ @SuppressWarnings("unchecked") public List<${jdoInfo.javaClassName}> findBy$util.doNameCreator.attribute2class($col.javaAttName)($col.getNonPrimitifClass() ${col.javaAttName}) { - Query q = getSession().createQuery("from ${jdoInfo.javaClassName} where $util.doNameCreator.class2attribute($util.doNameCreator.createDoName(${colfk2.getPkTableName()})).${col.javaAttName} = :${col.javaAttName}"); - q.setParameter("${col.javaAttName}",${col.javaAttName}); - q.setCacheable(true); - return q.list(); + return findByCriteria(Restrictions.eq("$util.doNameCreator.class2attribute($util.doNameCreator.createDoName(${colfk2.getPkTableName()})).${col.javaAttName}", ${col.javaAttName})); } #end @@ -137,12 +104,8 @@ /** * Find ${jdoInfo.javaClassName} by ${col.javaAttName} */ - @SuppressWarnings("unchecked") public List<${jdoInfo.javaClassName}> findBy$util.doNameCreator.attribute2class($col.javaAttName)($col.getNonPrimitifClass() ${col.javaAttName}) { - Query q = getSession().createQuery("from ${jdoInfo.javaClassName} where ${col.javaAttName} = :${col.javaAttName}"); - q.setParameter("${col.javaAttName}",${col.javaAttName}); - q.setCacheable(true); - return q.list(); + return findByCriteria(Restrictions.eq("${col.javaAttName}", ${col.javaAttName})); } #end Modified: salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm 2007-04-23 17:18:16 UTC (rev 292) +++ salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm 2007-04-24 10:10:29 UTC (rev 293) @@ -4,12 +4,14 @@ import java.io.Serializable; import java.lang.reflect.ParameterizedType; import java.util.List; +import java.util.Map; import org.hibernate.Criteria; import org.hibernate.FlushMode; import org.hibernate.Query; import org.hibernate.LockMode; import org.hibernate.Session; +import org.hibernate.criterion.Restrictions; import org.hibernate.criterion.Criterion; import org.hibernate.criterion.Example; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-23 17:18:19
|
Revision: 292 http://svn.sourceforge.net/salto-db/?rev=292&view=rev Author: rflament Date: 2007-04-23 10:18:16 -0700 (Mon, 23 Apr 2007) Log Message: ----------- avoid duplication of code between spring/hibernate plugin and hibernate plugin Modified Paths: -------------- salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringEJB3AndHibernateDAOPlugin.java salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm Added Paths: ----------- salto-db-generator/trunk/templates/hibernateejb3dao/common-abstracthibernatedao.vm Removed Paths: ------------- salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm Modified: salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringEJB3AndHibernateDAOPlugin.java =================================================================== --- salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringEJB3AndHibernateDAOPlugin.java 2007-04-21 16:20:12 UTC (rev 291) +++ salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringEJB3AndHibernateDAOPlugin.java 2007-04-23 17:18:16 UTC (rev 292) @@ -23,25 +23,19 @@ ejb3Plugin.execute(className, info); CreatorUtil.getDoNameCreator().setPrefix(doPrefix); - CreatorUtil.getDoNameCreator().setDefaultNameOffset( - this.defaultNameOffset); + CreatorUtil.getDoNameCreator().setDefaultNameOffset(this.defaultNameOffset); Map context = new HashMap(); context.put("jdoInfo", info); context.put("util", CreatorUtil.getInstance()); context.put("templatePath", TEMPLATE_PATH); - context.put("generatorVersion", Constants.GENERATOR_NAME + " / " - + this.getShortDescription()); + context.put("generatorVersion", Constants.GENERATOR_NAME + " / " + this.getShortDescription()); context.put("date", new Date()); info.setJavaPckName(pckName); info.setJavaClassName(className); - runVelocity(TEMPLATE_PATH, "springhibernatedao.vm", srcPath + "/" - + (pckName + ".hibernate").replace('.', '/') + "/", className - + "HibernateDAO.java", context); + runVelocity(EJB3AndHibernateDAOPlugin.TEMPLATE_PATH, "hibernatedao.vm", srcPath + "/" + (pckName + ".hibernate").replace('.', '/') + "/", className + "HibernateDAO.java", context); - runVelocity(EJB3AndHibernateDAOPlugin.TEMPLATE_PATH, "dao.vm", srcPath - + "/" + pckName.replace('.', '/') + "/", - className + "DAO.java", context); + runVelocity(EJB3AndHibernateDAOPlugin.TEMPLATE_PATH, "dao.vm", srcPath + "/" + pckName.replace('.', '/') + "/", className + "DAO.java", context); } @@ -64,42 +58,33 @@ public void postExecute(JdoInfo[] infos) throws Exception { CreatorUtil.getDoNameCreator().setPrefix(doPrefix); - CreatorUtil.getDoNameCreator().setDefaultNameOffset( - this.defaultNameOffset); + CreatorUtil.getDoNameCreator().setDefaultNameOffset(this.defaultNameOffset); Map context = new HashMap(); context.put("jdoInfos", infos); context.put("connInfo", infos[0].getConnInfo()); context.put("util", CreatorUtil.getInstance()); context.put("templatePath", TEMPLATE_PATH); - context.put("generatorVersion", Constants.GENERATOR_NAME + " / " - + this.getShortDescription()); + context.put("generatorVersion", Constants.GENERATOR_NAME + " / " + this.getShortDescription()); context.put("date", new Date()); context.put("dialect", this.ejb3Plugin); context.put("pckName", pckName); - context.put("annotations", String.valueOf(ejb3Plugin - .isGenerateAnnotations())); + context.put("annotations", String.valueOf(ejb3Plugin.isGenerateAnnotations())); context.put("hibernateDialectHelper", new HibernateDialectHelper()); + context.put("ejb3daotemplatePath", EJB3AndHibernateDAOPlugin.TEMPLATE_PATH); - runVelocity(TEMPLATE_PATH, "springabstracthibernatedao.vm", srcPath - + "/" + (pckName + ".hibernate").replace('.', '/') + "/", - "AbstractHibernateDAO.java", context); + runVelocity(TEMPLATE_PATH, "springabstracthibernatedao.vm", srcPath + "/" + (pckName + ".hibernate").replace('.', '/') + "/", "AbstractHibernateDAO.java", context); - runVelocity(TEMPLATE_PATH, "genericdao.vm", srcPath + "/" - + pckName.replace('.', '/') + "/", "GenericDAO.java", context); + runVelocity(EJB3AndHibernateDAOPlugin.TEMPLATE_PATH, "genericdao.vm", srcPath + "/" + pckName.replace('.', '/') + "/", "GenericDAO.java", context); - runVelocity(TEMPLATE_PATH, "applicationContext-resources.xml.vm", - srcPath, "applicationContext-resources.xml", context); - runVelocity(TEMPLATE_PATH, "applicationContext-hibernate.xml.vm", - srcPath, "applicationContext-hibernate.xml", context); + runVelocity(TEMPLATE_PATH, "applicationContext-resources.xml.vm", srcPath, "applicationContext-resources.xml", context); + runVelocity(TEMPLATE_PATH, "applicationContext-hibernate.xml.vm", srcPath, "applicationContext-hibernate.xml", context); } - public void init(String doPrefix, int defaultNameOffset, - String srcPath, String pckName) throws Exception { + public void init(String doPrefix, int defaultNameOffset, String srcPath, String pckName) throws Exception { super.init(doPrefix, defaultNameOffset, srcPath, pckName); ejb3Plugin = new EJB3Plugin(); - ejb3Plugin.init(doPrefix, defaultNameOffset, srcPath, - pckName + ".pojo"); + ejb3Plugin.init(doPrefix, defaultNameOffset, srcPath, pckName + ".pojo"); } public EJB3Plugin getEjb3Plugin() { Modified: salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm 2007-04-21 16:20:12 UTC (rev 291) +++ salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm 2007-04-23 17:18:16 UTC (rev 292) @@ -29,126 +29,16 @@ this.persistentClass = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]; } - protected Session getSession() { + public void setSession(Session session) { + this.session = session; + } + + protected Session getSession() { if (session == null) session = HibernateUtil.getSessionFactory().getCurrentSession(); return session; } - public Class<T> getPersistentClass() { - return persistentClass; - } - - public void setSession(Session session) { - this.session = session; - } - - @SuppressWarnings("unchecked") - public T getById(ID id) { - return (T) getSession().get(getPersistentClass(), id); - } - - @SuppressWarnings("unchecked") - public T getById(ID id, boolean lock) { - if (lock) { - return (T) getSession().get(getPersistentClass(), id, - LockMode.UPGRADE); - } else - return getById(id); - } +#parse("${templatePath}/common-abstracthibernatedao.vm") - @SuppressWarnings("unchecked") - public T loadById(ID id) { - return (T) getSession().load(getPersistentClass(), id); - } - - public void save(T entity) { - getSession().save(entity); - } - - public void update(T entity) { - getSession().update(entity); - } - - public void saveOrUpdate(T entity) { - getSession().saveOrUpdate(entity); - } - - public void delete(T entity) { - getSession().delete(entity); - } - - public void delete(T entity, Boolean doItNow) { - if (doItNow) { - getSession().setFlushMode(FlushMode.ALWAYS); - } - delete(entity); - } - - @SuppressWarnings("unchecked") - public List<T> findAll() { - return findByCriteria(); - } - - /** - * Use this inside subclasses as a convenience method. - */ - @SuppressWarnings("unchecked") - protected List<T> findByCriteria(Criterion... criterion) { - Criteria crit = getSession().createCriteria(getPersistentClass()); - for (Criterion c : criterion) { - crit.add(c); - } - return crit.list(); - } - - /** - * This method will execute an HQL query and return the number of affected entities. - */ - protected int executeQuery(String query, String namedParams[], Object params[]) { - Query q = getSession().createQuery(query); - - if (namedParams != null) { - for (int i = 0; i < namedParams.length; i++) { - q.setParameter(namedParams[i], params[i]); - } - } - - return q.executeUpdate(); - } - - protected int executeQuery(String query) { - return executeQuery(query, null, null); - } - - /** - * This method will execute a Named HQL query and return the number of affected entities. - */ - protected int executeNamedQuery(String namedQuery, String namedParams[], Object params[]) { - Query q = getSession().getNamedQuery(namedQuery); - - if (namedParams != null) { - for (int i = 0; i < namedParams.length; i++) { - q.setParameter(namedParams[i], params[i]); - } - } - - return q.executeUpdate(); - } - - protected int executeNamedQuery(String namedQuery) { - return executeNamedQuery(namedQuery, null, null); - } - - @SuppressWarnings("unchecked") - public List<T> findByExample(T exampleInstance, String[] excludeProperty) { - Criteria crit = getSession().createCriteria(getPersistentClass()); - Example example = Example.create(exampleInstance).excludeZeroes().enableLike().ignoreCase(); - for (String exclude : excludeProperty) { - example.excludeProperty(exclude); - } - crit.add(example); - return crit.list(); - } - } Added: salto-db-generator/trunk/templates/hibernateejb3dao/common-abstracthibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/common-abstracthibernatedao.vm (rev 0) +++ salto-db-generator/trunk/templates/hibernateejb3dao/common-abstracthibernatedao.vm 2007-04-23 17:18:16 UTC (rev 292) @@ -0,0 +1,111 @@ + public Class<T> getPersistentClass() { + return persistentClass; + } + + @SuppressWarnings("unchecked") + public T getById(ID id) { + return (T) getSession().get(getPersistentClass(), id); + } + + @SuppressWarnings("unchecked") + public T getById(ID id, boolean lock) { + if (lock) { + return (T) getSession().get(getPersistentClass(), id, + LockMode.UPGRADE); + } else + return getById(id); + } + + @SuppressWarnings("unchecked") + public T loadById(ID id) { + return (T) getSession().load(getPersistentClass(), id); + } + + public void save(T entity) { + getSession().save(entity); + } + + public void update(T entity) { + getSession().update(entity); + } + + public void saveOrUpdate(T entity) { + getSession().saveOrUpdate(entity); + } + + public void delete(T entity) { + getSession().delete(entity); + } + + public void delete(T entity, Boolean doItNow) { + if (doItNow) { + getSession().setFlushMode(FlushMode.ALWAYS); + } + delete(entity); + } + + @SuppressWarnings("unchecked") + public List<T> findAll() { + return findByCriteria(); + } + + /** + * Use this inside subclasses as a convenience method. + */ + @SuppressWarnings("unchecked") + protected List<T> findByCriteria(Criterion... criterion) { + Criteria crit = getSession().createCriteria(getPersistentClass()); + for (Criterion c : criterion) { + crit.add(c); + } + return crit.list(); + } + + /** + * This method will execute an HQL query and return the number of affected entities. + */ + protected int executeQuery(String query, String namedParams[], Object params[]) { + Query q = getSession().createQuery(query); + + if (namedParams != null) { + for (int i = 0; i < namedParams.length; i++) { + q.setParameter(namedParams[i], params[i]); + } + } + + return q.executeUpdate(); + } + + protected int executeQuery(String query) { + return executeQuery(query, null, null); + } + + /** + * This method will execute a Named HQL query and return the number of affected entities. + */ + protected int executeNamedQuery(String namedQuery, String namedParams[], Object params[]) { + Query q = getSession().getNamedQuery(namedQuery); + + if (namedParams != null) { + for (int i = 0; i < namedParams.length; i++) { + q.setParameter(namedParams[i], params[i]); + } + } + + return q.executeUpdate(); + } + + protected int executeNamedQuery(String namedQuery) { + return executeNamedQuery(namedQuery, null, null); + } + + @SuppressWarnings("unchecked") + public List<T> findByExample(T exampleInstance, String[] excludeProperty) { + Criteria crit = getSession().createCriteria(getPersistentClass()); + Example example = Example.create(exampleInstance).excludeZeroes().enableLike().ignoreCase(); + for (String exclude : excludeProperty) { + example.excludeProperty(exclude); + } + crit.add(example); + return crit.list(); + } \ No newline at end of file Modified: salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm 2007-04-21 16:20:12 UTC (rev 291) +++ salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm 2007-04-23 17:18:16 UTC (rev 292) @@ -12,7 +12,6 @@ import org.hibernate.Criteria; import org.hibernate.Query; -import org.hibernate.Session; import org.hibernate.criterion.Restrictions; #set ($pk="Long") #foreach($col in ${jdoInfo.jdoColInfos}) Deleted: salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm 2007-04-21 16:20:12 UTC (rev 291) +++ salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm 2007-04-23 17:18:16 UTC (rev 292) @@ -1,33 +0,0 @@ -package $pckName; - -import java.io.Serializable; -import java.util.List; - -/** - * Generated at $date - * - * @author ${generatorVersion} - */ -public interface GenericDAO<T, ID extends Serializable> { - - T getById(ID id); - - T loadById(ID id); - - List<T> findAll(); - - void save(T entity); - - void update(T entity); - - void saveOrUpdate(T entity); - - void delete(T entity); - - void delete(T entity, Boolean doItNow); - - void deleteById(ID id); - - public List<T> findByExample(T exampleInstance, String[] excludeProperty); - -} \ No newline at end of file Modified: salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm 2007-04-21 16:20:12 UTC (rev 291) +++ salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm 2007-04-23 17:18:16 UTC (rev 292) @@ -19,6 +19,7 @@ * Generated at $date * * @author ${generatorVersion} + * @see http://www.hibernate.org/328.html */ public abstract class AbstractHibernateDAO<T, ID extends Serializable> extends HibernateDaoSupport implements GenericDAO<T, ID> { @@ -28,111 +29,5 @@ this.persistentClass = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0]; } - public Class<T> getPersistentClass() { - return persistentClass; - } - - @SuppressWarnings("unchecked") - public T getById(ID id) { - return (T) getSession().get(getPersistentClass(), id); - } - - @SuppressWarnings("unchecked") - public T getById(ID id, boolean lock) { - if (lock) { - return (T) getSession().get(getPersistentClass(), id, - LockMode.UPGRADE); - } else - return getById(id); - } - - public void save(T entity) { - getSession().save(entity); - } - - public void update(T entity) { - getSession().update(entity); - } - - public void saveOrUpdate(T entity) { - getSession().saveOrUpdate(entity); - } - - public void delete(T entity) { - getSession().delete(entity); - } - - public void delete(T entity, Boolean doItNow) { - if (doItNow) { - getSession().setFlushMode(FlushMode.ALWAYS); - } - delete(entity); - } - - @SuppressWarnings("unchecked") - public List<T> findAll() { - return findByCriteria(); - } - - /** - * Use this inside subclasses as a convenience method. - */ - @SuppressWarnings("unchecked") - protected List<T> findByCriteria(Criterion... criterion) { - Criteria crit = getSession().createCriteria(getPersistentClass()); - for (Criterion c : criterion) { - crit.add(c); - } - return crit.list(); - } - - /** - * This method will execute an HQL query and return the number of affected entities. - */ - protected int executeQuery(String query, String namedParams[], Object params[]) { - Query q = getSession().createQuery(query); - - if (namedParams != null) { - for (int i = 0; i < namedParams.length; i++) { - q.setParameter(namedParams[i], params[i]); - } - } - - return q.executeUpdate(); - } - - protected int executeQuery(String query) { - return executeQuery(query, null, null); - } - - /** - * This method will execute a Named HQL query and return the number of affected entities. - */ - protected int executeNamedQuery(String namedQuery, String namedParams[], Object params[]) { - Query q = getSession().getNamedQuery(namedQuery); - - if (namedParams != null) { - for (int i = 0; i < namedParams.length; i++) { - q.setParameter(namedParams[i], params[i]); - } - } - - return q.executeUpdate(); - } - - protected int executeNamedQuery(String namedQuery) { - return executeNamedQuery(namedQuery, null, null); - } - - @SuppressWarnings("unchecked") - public List<T> findByExample(T exampleInstance, String[] excludeProperty) { - Criteria crit = getSession().createCriteria(getPersistentClass()); - Example example = Example.create(exampleInstance).excludeZeroes().enableLike().ignoreCase(); - for (String exclude : excludeProperty) { - example.excludeProperty(exclude); - } - crit.add(example); - return crit.list(); - } - +#parse("${ejb3daotemplatePath}/common-abstracthibernatedao.vm") } Deleted: salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-21 16:20:12 UTC (rev 291) +++ salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-23 17:18:16 UTC (rev 292) @@ -1,166 +0,0 @@ -package ${jdoInfo.javaPckName}.hibernate; - -import java.util.Map; -import java.util.List; -import java.sql.Timestamp; - -import ${jdoInfo.javaPckName}.pojo.${jdoInfo.javaClassName}; -import ${jdoInfo.javaPckName}.${jdoInfo.javaClassName}DAO; -#if ($util.getLength($jdoInfo.getPk()) > 1) -import ${jdoInfo.javaPckName}.pojo.${jdoInfo.javaClassName}.${jdoInfo.javaClassName}PK; -#end - -import org.hibernate.Criteria; -import org.hibernate.Query; -import org.hibernate.criterion.Restrictions; -#set ($pk="Long") -#foreach($col in ${jdoInfo.jdoColInfos}) -#foreach($colpk in ${jdoInfo.getPk()}) -#if ($colpk.col.equals($col.colName)) -#set ($pk=$util.getClassNameForPrimitive($col.javaAttClass)) -#end -#end -#end -#if ($util.getLength($jdoInfo.getPk()) > 1) -#set ($pk="${jdoInfo.javaClassName}PK") -#end - -/** - * <p>Hibernate DAO layer for ${jdoInfo.javaClassName}s</p> - * <p>Generated at $date</p> - * - * @author ${generatorVersion} - */ -public class ${jdoInfo.javaClassName}HibernateDAO extends - AbstractHibernateDAO<${jdoInfo.javaClassName}, $pk> implements - ${jdoInfo.javaClassName}DAO { - - public ${jdoInfo.javaClassName} getById($pk id) { - return (${jdoInfo.javaClassName}) getSession().get(${jdoInfo.javaClassName}.class, id); - } - - public ${jdoInfo.javaClassName} loadById($pk id) { - return (${jdoInfo.javaClassName}) getSession().load(${jdoInfo.javaClassName}.class, id); - } - - /** - * Find ${jdoInfo.javaClassName} by criteria. - */ - @SuppressWarnings("unchecked") - public List<${jdoInfo.javaClassName}> findByCriteria(Map criterias) { - - Criteria criteria = getSession().createCriteria(${jdoInfo.javaClassName}.class); - criteria.add(Restrictions.allEq(criterias)); - return criteria.list(); - } - - public void deleteById($pk id) { - ${jdoInfo.javaClassName} $util.doNameCreator.class2attribute(${jdoInfo.javaClassName}) = loadById(id); - this.getSession().delete($util.doNameCreator.class2attribute(${jdoInfo.javaClassName})); - } - - @SuppressWarnings("unchecked") - public List<${jdoInfo.javaClassName}> findAll() { - Query q = getSession().createQuery("from ${jdoInfo.javaClassName}"); - q.setCacheable(true); - return q.list(); - } - -#if ($util.getLength($jdoInfo.getPk()) > 1) -#foreach($col in ${jdoInfo.jdoColInfos}) -#set ($ispk="false") -#foreach($colpk in ${jdoInfo.getPk()}) -#if ($colpk.col.equals($col.colName)) -#set ($ispk="true") -#end -#end -#set ($isfk="false") -#foreach($colfk in ${jdoInfo.getImportedFk()}) -#foreach($colfk2 in $colfk) -#if($colfk2.getFkColumnName().equals($col.colName)) -#set ($isfk="true") - /** - * Find ${jdoInfo.javaClassName} by ${col.javaAttName} - */ - @SuppressWarnings("unchecked") - public List<${jdoInfo.javaClassName}> findBy$util.doNameCreator.attribute2class($col.javaAttName)($col.getNonPrimitifClass() ${col.javaAttName}) { - Query q = getSession().createQuery("from ${jdoInfo.javaClassName} where $util.doNameCreator.class2attribute($util.doNameCreator.createDoName(${colfk2.getPkTableName()})).${col.javaAttName} = :${col.javaAttName}"); - q.setParameter("${col.javaAttName}",${col.javaAttName}); - q.setCacheable(true); - return q.list(); - } - -#end -#end -#end -#if ($isfk=="false" && $ispk=="false") - /** - * Find ${jdoInfo.javaClassName} by ${col.javaAttName} - */ - @SuppressWarnings("unchecked") - public List<${jdoInfo.javaClassName}> findBy$util.doNameCreator.attribute2class($col.javaAttName)($col.getNonPrimitifClass() ${col.javaAttName}) { - Query q = getSession().createQuery("from ${jdoInfo.javaClassName} where ${col.javaAttName} = :${col.javaAttName}"); - q.setParameter("${col.javaAttName}",${col.javaAttName}); - q.setCacheable(true); - return q.list(); - } - -#else -#if ($ispk=="true" && $isfk=="false") - /** - * Find ${jdoInfo.javaClassName} by ${col.javaAttName} - */ - @SuppressWarnings("unchecked") - public List<${jdoInfo.javaClassName}> findBy$util.doNameCreator.attribute2class($col.javaAttName)($col.getNonPrimitifClass() ${col.javaAttName}) { - Query q = getSession().createQuery("from ${jdoInfo.javaClassName} where id.${col.javaAttName} = :${col.javaAttName}"); - q.setParameter("${col.javaAttName}",${col.javaAttName}); - q.setCacheable(true); - return q.list(); - } -#end -#end -#end -#else -#foreach($col in ${jdoInfo.jdoColInfos}) -#set ($ispk="false") -#foreach($colpk in ${jdoInfo.getPk()}) -#if ($colpk.col.equals($col.colName)) -#set ($ispk="true") -#end -#end -#set ($isfk="false") -#foreach($colfk in ${jdoInfo.getImportedFk()}) -#foreach($colfk2 in $colfk) -#if($colfk2.getFkColumnName().equals($col.colName)) -#set ($isfk="true") - /** - * Find ${jdoInfo.javaClassName} by ${col.javaAttName} - */ - @SuppressWarnings("unchecked") - public List<${jdoInfo.javaClassName}> findBy$util.doNameCreator.attribute2class($col.javaAttName)($col.getNonPrimitifClass() ${col.javaAttName}) { - Query q = getSession().createQuery("from ${jdoInfo.javaClassName} where $util.doNameCreator.class2attribute($util.doNameCreator.createDoName(${colfk2.getPkTableName()})).${col.javaAttName} = :${col.javaAttName}"); - q.setParameter("${col.javaAttName}",${col.javaAttName}); - q.setCacheable(true); - return q.list(); - } - -#end -#end -#end -#if ($ispk=="false" && $isfk=="false") - /** - * Find ${jdoInfo.javaClassName} by ${col.javaAttName} - */ - @SuppressWarnings("unchecked") - public List<${jdoInfo.javaClassName}> findBy$util.doNameCreator.attribute2class($col.javaAttName)($col.getNonPrimitifClass() ${col.javaAttName}) { - Query q = getSession().createQuery("from ${jdoInfo.javaClassName} where ${col.javaAttName} = :${col.javaAttName}"); - q.setParameter("${col.javaAttName}",${col.javaAttName}); - q.setCacheable(true); - return q.list(); - } - -#end -#end -#end - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From:
<ji...@is...> - 2007-04-23 16:39:10
|
Too many open cursors with Oracle --------------------------------- Key: SALTODB-15 URL: http://issues.salto-consulting.com/jira/browse/SALTOD= B-15 Project: Salto-db Issue Type: Bug Components: Salto-db Generator Environment: oracle Reporter: R=C3=A9mi Flament Assigned To: R=C3=A9mi Flament When there's a lot of tables, generation crashes with the error message "TO= O MANY OPEN CURSORS" --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.salto-consulting.com/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From:
<ji...@is...> - 2007-04-23 16:32:11
|
Multiple match in tablesNames generates a wrong spring config file ------------------------------------------------------------------ Key: SALTODB-14 URL: http://issues.salto-consulting.com/jira/browse/SALTOD= B-14 Project: Salto-db Issue Type: Bug Components: Salto-db Generator Reporter: R=C3=A9mi Flament Assigned To: R=C3=A9mi Flament Priority: Minor In the ant build.xml file user can choose multiple pattern to select tables= . As an example user can say he wants to generate code for table that start w= ith 'R' or that end with 'K', to do that he would set tablesNames=3D"R%,%K". But if a table is named RATAPOUAK then both patterns will select it, and th= e pojo will be generated twice. This is a problem for configuration files b= ecause we end up with twice the same dao declared in the applicationContext= -hibernate.xml file, and so spring refuses to start. --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.salto-consulting.com/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From:
<ji...@is...> - 2007-04-23 16:15:12
|
Tables without primary key or views don't work out of the box with hibernat= e ---------------------------------------------------------------------------= - Key: SALTODB-13 URL: http://issues.salto-consulting.com/jira/browse/SALTOD= B-13 Project: Salto-db Issue Type: Bug Components: Salto-db Generator Reporter: R=C3=A9mi Flament Assigned To: R=C3=A9mi Flament Priority: Minor When a table doesn't have any primary key or when the code is generated fro= m a view, there's no column with the @Id annotation in the generated pojo. Hibernate refuses to start. The generator should : - refuse to generate the pojo (but that would mean that we cannot use views= ) - use every columns as a primary key (not perfect, but at least it starts) --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.salto-consulting.com/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From:
<ji...@is...> - 2007-04-23 16:10:21
|
EJB3 association mapping ------------------------ Key: SALTODB-12 URL: http://issues.salto-consulting.com/jira/browse/SALTOD= B-12 Project: Salto-db Issue Type: Bug Components: Salto-db Generator Reporter: R=C3=A9mi Flament Assigned To: R=C3=A9mi Flament Priority: Minor When you generate pojo for tables you don't necessarily select every tables= in the database. If you have a table A with a foreign key to a table B and if you generate c= ode only for table A, the generated pojo will have a=20 private B b; // attribute mapping association and so there will be compiler errors since B is not generated. So the generator should : - select automatically the table B (and so on, if B references C, then sele= ct C), or - replace attribute B by a simple type column (like int or long, depending = on the column type), or - refuse to generate code because it won't compile anyway --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.salto-consulting.com/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: <rfl...@us...> - 2007-04-21 16:20:12
|
Revision: 291 http://svn.sourceforge.net/salto-db/?rev=291&view=rev Author: rflament Date: 2007-04-21 09:20:12 -0700 (Sat, 21 Apr 2007) Log Message: ----------- new mailing list for users questions (without svn commits) Modified Paths: -------------- salto-db-generator/trunk/pom.xml Modified: salto-db-generator/trunk/pom.xml =================================================================== --- salto-db-generator/trunk/pom.xml 2007-04-21 16:14:39 UTC (rev 290) +++ salto-db-generator/trunk/pom.xml 2007-04-21 16:20:12 UTC (rev 291) @@ -17,7 +17,20 @@ <inceptionYear>2002</inceptionYear> - <mailingLists> + <mailingLists> + <mailingList> + <name>salto-db-users</name> + <subscribe> + http://lists.sourceforge.net/lists/listinfo/salto-db-users + </subscribe> + <unsubscribe> + http://lists.sourceforge.net/lists/listinfo/salto-db-users + </unsubscribe> + <post></post> + <archive> + http://sourceforge.net/mailarchive/forum.php?forum_name=salto-db-users + </archive> + </mailingList> <mailingList> <name>salto-db-devs</name> <subscribe> @@ -28,7 +41,7 @@ </unsubscribe> <post></post> <archive> - http://sourceforge.net/mailarchive/forum.php?forum=salto-db-devs + http://sourceforge.net/mailarchive/forum.php?forum_name=salto-db-devs </archive> </mailingList> </mailingLists> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-21 16:14:40
|
Revision: 290 http://svn.sourceforge.net/salto-db/?rev=290&view=rev Author: rflament Date: 2007-04-21 09:14:39 -0700 (Sat, 21 Apr 2007) Log Message: ----------- put appfuse.zip in the jar Modified Paths: -------------- salto-db-generator/trunk/pom.xml Modified: salto-db-generator/trunk/pom.xml =================================================================== --- salto-db-generator/trunk/pom.xml 2007-04-21 16:05:07 UTC (rev 289) +++ salto-db-generator/trunk/pom.xml 2007-04-21 16:14:39 UTC (rev 290) @@ -13,7 +13,7 @@ <packaging>jar</packaging> - <version>1.0.15</version> + <version>1.0.16</version> <inceptionYear>2002</inceptionYear> @@ -67,7 +67,8 @@ <directory>src</directory> <includes> <include>**/*.xml</include> - <include>**/*.txt</include> + <include>**/*.txt</include> + <include>**/*.zip</include> </includes> <excludes> <exclude>site/*</exclude> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-21 16:05:15
|
Revision: 289 http://svn.sourceforge.net/salto-db/?rev=289&view=rev Author: rflament Date: 2007-04-21 09:05:07 -0700 (Sat, 21 Apr 2007) Log Message: ----------- I think these libraries are not useful in our case, I will commit them back if I'm wrong... Modified Paths: -------------- salto-db-generator/trunk/templates/springwebapp/pom.xml.vm Modified: salto-db-generator/trunk/templates/springwebapp/pom.xml.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/pom.xml.vm 2007-04-21 15:58:04 UTC (rev 288) +++ salto-db-generator/trunk/templates/springwebapp/pom.xml.vm 2007-04-21 16:05:07 UTC (rev 289) @@ -167,12 +167,6 @@ <scope>compile</scope> </dependency> <dependency> - <groupId>net.sf.ehcache</groupId> - <artifactId>ehcache</artifactId> - <version>1.2.3</version> - <scope>compile</scope> - </dependency> - <dependency> <groupId>dom4j</groupId> <artifactId>dom4j</artifactId> <version>1.3</version> @@ -192,12 +186,6 @@ </dependency> <dependency> <groupId>opensymphony</groupId> - <artifactId>oscache</artifactId> - <version>2.3.2</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>opensymphony</groupId> <artifactId>sitemesh</artifactId> <version>2.2.1</version> <scope>compile</scope> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-21 15:58:06
|
Revision: 288 http://svn.sourceforge.net/salto-db/?rev=288&view=rev Author: rflament Date: 2007-04-21 08:58:04 -0700 (Sat, 21 Apr 2007) Log Message: ----------- remove oracle jdbc driver dependency Modified Paths: -------------- salto-db-generator/trunk/templates/springwebapp/pom.xml.vm Modified: salto-db-generator/trunk/templates/springwebapp/pom.xml.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/pom.xml.vm 2007-04-21 15:55:35 UTC (rev 287) +++ salto-db-generator/trunk/templates/springwebapp/pom.xml.vm 2007-04-21 15:58:04 UTC (rev 288) @@ -257,12 +257,6 @@ <scope>provided</scope> </dependency> <dependency> - <groupId>ojdbc</groupId> - <artifactId>ojdbc</artifactId> - <version>14</version> - <scope>provided</scope> - </dependency> - <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-21 15:55:38
|
Revision: 287 http://svn.sourceforge.net/salto-db/?rev=287&view=rev Author: rflament Date: 2007-04-21 08:55:35 -0700 (Sat, 21 Apr 2007) Log Message: ----------- return void instead of int Modified Paths: -------------- salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm Modified: salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-20 12:20:59 UTC (rev 286) +++ salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-21 15:55:35 UTC (rev 287) @@ -54,7 +54,7 @@ return criteria.list(); } - public int deleteById($pk id) { + public void deleteById($pk id) { ${jdoInfo.javaClassName} $util.doNameCreator.class2attribute(${jdoInfo.javaClassName}) = loadById(id); this.getSession().delete($util.doNameCreator.class2attribute(${jdoInfo.javaClassName})); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-20 12:21:01
|
Revision: 286 http://svn.sourceforge.net/salto-db/?rev=286&view=rev Author: rflament Date: 2007-04-20 05:20:59 -0700 (Fri, 20 Apr 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm Modified: salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm 2007-04-20 09:42:25 UTC (rev 285) +++ salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm 2007-04-20 12:20:59 UTC (rev 286) @@ -49,8 +49,8 @@ } public void deleteById($pk id) { - ${jdoInfo.javaClassName} $util.doNameCreator.class2attribute($col.javaAttName) = loadById(id); - this.getSession().delete($util.doNameCreator.class2attribute($col.javaAttName)); + ${jdoInfo.javaClassName} $util.doNameCreator.class2attribute(${jdoInfo.javaClassName}) = loadById(id); + this.getSession().delete($util.doNameCreator.class2attribute(${jdoInfo.javaClassName})); } #if ($util.getLength($jdoInfo.getPk()) > 1) Modified: salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-20 09:42:25 UTC (rev 285) +++ salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-20 12:20:59 UTC (rev 286) @@ -55,8 +55,8 @@ } public int deleteById($pk id) { - ${jdoInfo.javaClassName} $util.doNameCreator.class2attribute($col.javaAttName) = loadById(id); - this.getSession().delete($util.doNameCreator.class2attribute($col.javaAttName)); + ${jdoInfo.javaClassName} $util.doNameCreator.class2attribute(${jdoInfo.javaClassName}) = loadById(id); + this.getSession().delete($util.doNameCreator.class2attribute(${jdoInfo.javaClassName})); } @SuppressWarnings("unchecked") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-20 09:42:45
|
Revision: 285 http://svn.sourceforge.net/salto-db/?rev=285&view=rev Author: rflament Date: 2007-04-20 02:42:25 -0700 (Fri, 20 Apr 2007) Log Message: ----------- generate a pom.xml file so the generated webapp can be built with maven Modified Paths: -------------- salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java Added Paths: ----------- salto-db-generator/trunk/templates/springwebapp/pom.xml.vm Modified: salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java =================================================================== --- salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java 2007-04-16 17:36:58 UTC (rev 284) +++ salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java 2007-04-20 09:42:25 UTC (rev 285) @@ -77,6 +77,7 @@ runVelocity(TEMPLATE_PATH, "menu2.jsp.vm", srcPath + "/WebContent/WEB-INF/pages", "menu.jsp", context); runVelocity(TEMPLATE_PATH, "menu-config.xml.vm", srcPath + "/WebContent/WEB-INF/", "menu-config.xml", context); runVelocity(TEMPLATE_PATH, "log4j.properties.vm", srcPath + "/src/", "log4j.properties", context); + runVelocity(TEMPLATE_PATH, "pom.xml.vm", srcPath + "/", "pom.xml", context); // unzip appfuse.zip ZipUtil.unzip(this.getClass().getClassLoader().getResourceAsStream("appfuse.zip"), srcPath + "/"); Added: salto-db-generator/trunk/templates/springwebapp/pom.xml.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/pom.xml.vm (rev 0) +++ salto-db-generator/trunk/templates/springwebapp/pom.xml.vm 2007-04-20 09:42:25 UTC (rev 285) @@ -0,0 +1,315 @@ +<?xml version="1.0"?><project> + <modelVersion>4.0.0</modelVersion> + <groupId>com.salto.pouak</groupId> + <artifactId>pouak</artifactId> + <packaging>war</packaging> + <name>pouak</name> + <version>1.0-SNAPSHOT</version> + <description>pouak</description> + + + + <build> + <sourceDirectory>src</sourceDirectory> + <resources> + <resource> + <filtering>true</filtering> + <directory>src</directory> + <includes> + <include>**/*.dtd</include> + <include>**/*.gif</include> + <include>**/*.xsd</include> + <include>**/*.xml</include> + <include>**/*.properties</include> + <include>**/*.txt</include> + <include>**/*.vm</include> + </includes> + </resource> + <resource> + <filtering>true</filtering> + <directory>WebContent</directory> + <includes> + <include>**/*.xml</include> + </includes> + </resource> + </resources> + <finalName>pouak</finalName> + <plugins> + <plugin> + <artifactId>maven-war-plugin</artifactId> + <version>2.0</version> + <configuration> + <webResources> + <resource> + <directory>WebContent</directory> + <excludes> + <exclude>**/*.jar</exclude> + </excludes> + </resource> + </webResources> + </configuration> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <compilerVersion>1.5</compilerVersion> + <encoding>UTF-8</encoding> + <source>1.5</source> + <target>1.5</target> + <debug>true</debug> + <showDeprecation>false</showDeprecation> + <showWarnings>false</showWarnings> + <optimize>false</optimize> + </configuration> + </plugin> + + </plugins> + </build> + <repositories> + <repository> + <releases> + <enabled>false</enabled> + </releases> + <snapshots /> + <id>Maven Snapshots</id> + <url>http://snapshots.maven.codehaus.org/maven2/</url> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <releases> + <enabled>false</enabled> + </releases> + <snapshots /> + <id>Maven Snapshots</id> + <url>http://snapshots.maven.codehaus.org/maven2/</url> + </pluginRepository> + <pluginRepository> + <releases> + <enabled>false</enabled> + </releases> + <snapshots /> + <id>Apache Snapshots</id> + <url>http://people.apache.org/repo/m2-snapshot-repository/</url> + </pluginRepository> + </pluginRepositories> + <dependencies> + <dependency> + <groupId>org.acegisecurity</groupId> + <artifactId>acegi-security</artifactId> + <version>1.0.3</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-webmvc</artifactId> + <version>2.0.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring</artifactId> + <version>2.0.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-hibernate3</artifactId> + <version>2.0.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-aop</artifactId> + <version>2.0.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>springmodules</groupId> + <artifactId>springmodules-validation</artifactId> + <version>0.4</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>struts-menu</groupId> + <artifactId>struts-menu</artifactId> + <version>2.4.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>aspectj</groupId> + <artifactId>aspectjweaver</artifactId> + <version>1.5.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>displaytag</groupId> + <artifactId>displaytag</artifactId> + <version>1.1</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>velocity</groupId> + <artifactId>velocity</artifactId> + <version>1.4</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.hibernate</groupId> + <artifactId>hibernate-annotations</artifactId> + <version>3.2.0.ga</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>javax.transaction</groupId> + <artifactId>jta</artifactId> + <version>1.0.1B</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>net.sf.ehcache</groupId> + <artifactId>ehcache</artifactId> + <version>1.2.3</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + <version>1.3</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jstl</artifactId> + <version>1.1.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>taglibs</groupId> + <artifactId>standard</artifactId> + <version>1.1.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>opensymphony</groupId> + <artifactId>oscache</artifactId> + <version>2.3.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>opensymphony</groupId> + <artifactId>sitemesh</artifactId> + <version>2.2.1</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>opensymphony</groupId> + <artifactId>clickstream</artifactId> + <version>1.0.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.tuckey</groupId> + <artifactId>urlrewrite</artifactId> + <version>3.0-beta</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-attributes</groupId> + <artifactId>commons-attributes-api</artifactId> + <version>2.1</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-beanutils</groupId> + <artifactId>commons-beanutils</artifactId> + <version>1.7.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + <version>3.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + <version>1.3</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-discovery</groupId> + <artifactId>commons-discovery</artifactId> + <version>0.2</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.1</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jsp-api</artifactId> + <version>2.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>ojdbc</groupId> + <artifactId>ojdbc</artifactId> + <version>14</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.mail</groupId> + <artifactId>mail</artifactId> + <version>1.4</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>jmock</groupId> + <artifactId>jmock</artifactId> + <version>1.1.0</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-mock</artifactId> + <version>2.0.2</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>dumbster</groupId> + <artifactId>dumbster</artifactId> + <version>1.5</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>ant</groupId> + <artifactId>ant</artifactId> + <version>1.6.5</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>commons-fileupload</groupId> + <artifactId>commons-fileupload</artifactId> + <version>1.2</version> + </dependency> + </dependencies> + + +</project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Bobby P. <pet...@gm...> - 2007-04-19 19:49:15
|
I found Salto DB generator yesterday and started playing around with it. It is great! But, I noticed that in the latest version there is support for Spring with the SpringEJB3AndHibernateDao Plugin, I would really like to use that because we are using Spring on my project. I tried to use it through the Ant Tasks and a NullPointerException was thrown. So I tried one of the other plugins that used to work in tag version 1.0.15 just to check and see if it was the plugin or something else and it failed at the same place. So it's not the plugin. Do any of you know where I could look to try and fix the issue? Thanks in advance. [salto-db-generate] org.apache.velocity.exception.MethodInvocationException: Inv ocation of method 'class2attribute' in class salto.tool.jdo.util.DoNameCreator threw exception class java.lang.NullPointerException : null [salto-db-generate] at org.apache.velocity.runtime.parser.node.ASTMethod.exe cute(ASTMethod.java:246) [salto-db-generate] at org.apache.velocity.runtime.parser.node.ASTReference. execute(ASTReference.java:175) [salto-db-generate] at org.apache.velocity.runtime.parser.node.ASTReference. render(ASTReference.java:220) [salto-db-generate] at org.apache.velocity.runtime.parser.node.SimpleNode.re nder(SimpleNode.java:230) [salto-db-generate] at org.apache.velocity.Template.merge(Template.java :256) [salto-db-generate] at com.salto.db.generator.plugin.VelocityAbstractPlugin. runVelocity(VelocityAbstractPlugin.java:65) [salto-db-generate] at com.salto.db.generator.plugin.EJB3AndHibernateDAOPlug in.execute(EJB3AndHibernateDAOPlugin.java:38) [salto-db-generate] at salto.tool.jdo.DataObjectCreate.creerDoSimple (DataObj ectCreate.java:170) [salto-db-generate] at com.salto.db.ant.DOGeneratorTask.execute (DOGeneratorT ask.java:167) [salto-db-generate] at org.apache.tools.ant.UnknownElement.execute (UnknownEl ement.java:275) [salto-db-generate] at org.apache.tools.ant.Task.perform(Task.java:364) [salto-db-generate] at org.apache.tools.ant.Target.execute(Target.java :341) [salto-db-generate] at org.apache.tools.ant.Target.performTasks( Target.java: 369) [salto-db-generate] at org.apache.tools.ant.Project.executeSortedTargets (Pro ject.java:1216) [salto-db-generate] at org.apache.tools.ant.Project.executeTarget( Project.ja va:1185) [salto-db-generate] at org.apache.tools.ant.helper.DefaultExecutor.executeTa rgets(DefaultExecutor.java:40) [salto-db-generate] at org.apache.tools.ant.Project.executeTargets( Project.j ava:1068) [salto-db-generate] at org.apache.tools.ant.Main.runBuild(Main.java:668) [salto-db-generate] at org.apache.tools.ant.Main.startAnt(Main.java:187) [salto-db-generate] at org.apache.tools.ant.launch.Launcher.run( Launcher.jav |
From: <rfl...@us...> - 2007-04-16 17:37:00
|
Revision: 284 http://svn.sourceforge.net/salto-db/?rev=284&view=rev Author: rflament Date: 2007-04-16 10:36:58 -0700 (Mon, 16 Apr 2007) Log Message: ----------- removeById didn't handle cascade on foreign keys Modified Paths: -------------- salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm Modified: salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm 2007-04-16 17:32:31 UTC (rev 283) +++ salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm 2007-04-16 17:36:58 UTC (rev 284) @@ -29,6 +29,6 @@ void delete(T entity, Boolean doItNow); - int deleteById(ID id); + void deleteById(ID id); } \ No newline at end of file Modified: salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm 2007-04-16 17:32:31 UTC (rev 283) +++ salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm 2007-04-16 17:36:58 UTC (rev 284) @@ -48,10 +48,9 @@ return criteria.list(); } - public int deleteById($pk id) { - Query q = getSession().createQuery("delete from ${jdoInfo.javaClassName} where id = :id"); - q.setParameter("id",id); - return q.executeUpdate(); + public void deleteById($pk id) { + ${jdoInfo.javaClassName} $util.doNameCreator.class2attribute($col.javaAttName) = loadById(id); + this.getSession().delete($util.doNameCreator.class2attribute($col.javaAttName)); } #if ($util.getLength($jdoInfo.getPk()) > 1) Modified: salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm 2007-04-16 17:32:31 UTC (rev 283) +++ salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm 2007-04-16 17:36:58 UTC (rev 284) @@ -26,7 +26,7 @@ void delete(T entity, Boolean doItNow); - int deleteById(ID id); + void deleteById(ID id); public List<T> findByExample(T exampleInstance, String[] excludeProperty); Modified: salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-16 17:32:31 UTC (rev 283) +++ salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-16 17:36:58 UTC (rev 284) @@ -55,9 +55,8 @@ } public int deleteById($pk id) { - Query q = getSession().createQuery("delete from ${jdoInfo.javaClassName} where id = :id"); - q.setParameter("id",id); - return q.executeUpdate(); + ${jdoInfo.javaClassName} $util.doNameCreator.class2attribute($col.javaAttName) = loadById(id); + this.getSession().delete($util.doNameCreator.class2attribute($col.javaAttName)); } @SuppressWarnings("unchecked") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-16 17:32:34
|
Revision: 283 http://svn.sourceforge.net/salto-db/?rev=283&view=rev Author: rflament Date: 2007-04-16 10:32:31 -0700 (Mon, 16 Apr 2007) Log Message: ----------- new loadById method Modified Paths: -------------- salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm Modified: salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm 2007-04-16 17:30:53 UTC (rev 282) +++ salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm 2007-04-16 17:32:31 UTC (rev 283) @@ -56,6 +56,11 @@ } else return getById(id); } + + @SuppressWarnings("unchecked") + public T loadById(ID id) { + return (T) getSession().load(getPersistentClass(), id); + } public void save(T entity) { getSession().save(entity); Modified: salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm 2007-04-16 17:30:53 UTC (rev 282) +++ salto-db-generator/trunk/templates/hibernateejb3dao/genericdao.vm 2007-04-16 17:32:31 UTC (rev 283) @@ -14,6 +14,8 @@ T getById(ID id, boolean lock); T getById(ID id); + + T loadById(ID id); List<T> findAll(); Modified: salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm 2007-04-16 17:30:53 UTC (rev 282) +++ salto-db-generator/trunk/templates/springhibernatedao/genericdao.vm 2007-04-16 17:32:31 UTC (rev 283) @@ -11,6 +11,8 @@ public interface GenericDAO<T, ID extends Serializable> { T getById(ID id); + + T loadById(ID id); List<T> findAll(); Modified: salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-16 17:30:53 UTC (rev 282) +++ salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-16 17:32:31 UTC (rev 283) @@ -39,6 +39,9 @@ return (${jdoInfo.javaClassName}) getSession().get(${jdoInfo.javaClassName}.class, id); } + public ${jdoInfo.javaClassName} loadById($pk id) { + return (${jdoInfo.javaClassName}) getSession().load(${jdoInfo.javaClassName}.class, id); + } /** * Find ${jdoInfo.javaClassName} by criteria. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-16 17:31:01
|
Revision: 282 http://svn.sourceforge.net/salto-db/?rev=282&view=rev Author: rflament Date: 2007-04-16 10:30:53 -0700 (Mon, 16 Apr 2007) Log Message: ----------- remove one of the findbycriteria method, it was useful only for tables that don't have many columns, and it was a real pain otherwise Modified Paths: -------------- salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm Modified: salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-16 17:29:06 UTC (rev 281) +++ salto-db-generator/trunk/templates/springhibernatedao/springhibernatedao.vm 2007-04-16 17:30:53 UTC (rev 282) @@ -39,33 +39,6 @@ return (${jdoInfo.javaClassName}) getSession().get(${jdoInfo.javaClassName}.class, id); } - /** - * Find ${jdoInfo.javaClassName} by criteria. - * If a parameter is null it is not used in the query. - * //FIXME: there's certainly an issue with foreign keys... - */ -#set ($isfirst="true") - @SuppressWarnings("unchecked") - public List<${jdoInfo.javaClassName}> findByCriteria(#foreach($col in ${jdoInfo.jdoColInfos})#set ($ispk="false")#foreach($colpk in ${jdoInfo.getPk()})#if ($colpk.col.equals($col.colName))#set ($ispk="true")#end#end#if ($ispk=="false")#if ($isfirst=="false"), #end$col.getNonPrimitifClass() ${col.javaAttName}#set ($isfirst="false")#end#end) { - - Criteria criteria = getSession().createCriteria(${jdoInfo.javaClassName}.class); - -#foreach($col in ${jdoInfo.jdoColInfos}) -#set ($ispk="false") -#foreach($colpk in ${jdoInfo.getPk()}) -#if ($colpk.col.equals($col.colName)) -#set ($ispk="true") -#end -#end -#if ($ispk=="false") - if (${col.javaAttName} != null) { - criteria.add(Restrictions.eq("${col.javaAttName}", ${col.javaAttName})); - } - -#end -#end - return criteria.list(); - } /** * Find ${jdoInfo.javaClassName} by criteria. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-16 17:29:08
|
Revision: 281 http://svn.sourceforge.net/salto-db/?rev=281&view=rev Author: rflament Date: 2007-04-16 10:29:06 -0700 (Mon, 16 Apr 2007) Log Message: ----------- remove one of the findbycriteria method, it was useful only for tables that don't have many columns, and it was a real pain otherwise Modified Paths: -------------- salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm Modified: salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm 2007-04-09 18:13:33 UTC (rev 280) +++ salto-db-generator/trunk/templates/hibernateejb3dao/dao.vm 2007-04-16 17:29:06 UTC (rev 281) @@ -34,17 +34,10 @@ * You might want to extend this interface and to change the dao factory to return * an instance of the new implemenation in build${jdoInfo.javaClassName}DAO() */ - + /** * Find ${jdoInfo.javaClassName} by criteria. - * If a parameter is null it is not used in the query. */ -#set ($isfirst="true") - public List<${jdoInfo.javaClassName}> findByCriteria(#foreach($col in ${jdoInfo.jdoColInfos})#set ($ispk="false")#foreach($colpk in ${jdoInfo.getPk()})#if ($colpk.col.equals($col.colName))#set ($ispk="true")#end#end#if ($ispk=="false")#if ($isfirst=="false"), #end$col.getNonPrimitifClass() ${col.javaAttName}#set ($isfirst="false")#end#end); - - /** - * Find ${jdoInfo.javaClassName} by criteria. - */ public List<${jdoInfo.javaClassName}> findByCriteria(Map criterias); Modified: salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm 2007-04-09 18:13:33 UTC (rev 280) +++ salto-db-generator/trunk/templates/hibernateejb3dao/hibernatedao.vm 2007-04-16 17:29:06 UTC (rev 281) @@ -36,34 +36,6 @@ public class ${jdoInfo.javaClassName}HibernateDAO extends AbstractHibernateDAO<${jdoInfo.javaClassName}, $pk> implements ${jdoInfo.javaClassName}DAO { - - /** - * Find ${jdoInfo.javaClassName} by criteria. - * If a parameter is null it is not used in the query. - * //FIXME: there's certainly an issue with foreign keys... - */ -#set ($isfirst="true") - @SuppressWarnings("unchecked") - public List<${jdoInfo.javaClassName}> findByCriteria(#foreach($col in ${jdoInfo.jdoColInfos})#set ($ispk="false")#foreach($colpk in ${jdoInfo.getPk()})#if ($colpk.col.equals($col.colName))#set ($ispk="true")#end#end#if ($ispk=="false")#if ($isfirst=="false"), #end$col.getNonPrimitifClass() ${col.javaAttName}#set ($isfirst="false")#end#end) { - - Criteria criteria = getSession().createCriteria(${jdoInfo.javaClassName}.class); - -#foreach($col in ${jdoInfo.jdoColInfos}) -#set ($ispk="false") -#foreach($colpk in ${jdoInfo.getPk()}) -#if ($colpk.col.equals($col.colName)) -#set ($ispk="true") -#end -#end -#if ($ispk=="false") - if (${col.javaAttName} != null) { - criteria.add(Restrictions.eq("${col.javaAttName}", ${col.javaAttName})); - } - -#end -#end - return criteria.list(); - } /** * Find ${jdoInfo.javaClassName} by criteria. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rfl...@us...> - 2007-04-09 18:13:36
|
Revision: 280 http://svn.sourceforge.net/salto-db/?rev=280&view=rev Author: rflament Date: 2007-04-09 11:13:33 -0700 (Mon, 09 Apr 2007) Log Message: ----------- appfuse integration Modified Paths: -------------- salto-db-generator/trunk/src/appfuse.zip salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm salto-db-generator/trunk/templates/springwebapp/ApplicationResources.properties.vm salto-db-generator/trunk/templates/springwebapp/action-servlet.xml.vm salto-db-generator/trunk/templates/springwebapp/editor.vm salto-db-generator/trunk/templates/springwebapp/emlist.jsp.vm salto-db-generator/trunk/templates/springwebapp/form.jsp.vm salto-db-generator/trunk/templates/springwebapp/list.jsp.vm salto-db-generator/trunk/templates/springwebapp/menu.jsp.vm salto-db-generator/trunk/templates/springwebapp/searchform.jsp.vm Added Paths: ----------- salto-db-generator/trunk/templates/springwebapp/menu-config.xml.vm salto-db-generator/trunk/templates/springwebapp/menu2.jsp.vm Removed Paths: ------------- salto-db-generator/trunk/templates/springwebapp/index.jsp.vm Modified: salto-db-generator/trunk/src/appfuse.zip =================================================================== (Binary files differ) Modified: salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java =================================================================== --- salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java 2007-04-09 18:13:33 UTC (rev 280) @@ -16,7 +16,7 @@ */ public class SpringWebappPlugin extends VelocityAbstractPlugin { - private SpringEJB3AndHibernateDAOAndTestCasesPlugin plugin; + private SpringEJB3AndHibernateDAOPlugin plugin; public static final String TEMPLATE_PATH = "springwebapp"; @@ -54,7 +54,7 @@ } public void postExecute(JdoInfo[] infos) throws Exception { - // plugin.srcPath += "/../webapp/WEB-INF/"; + plugin.postExecute(infos); CreatorUtil.getDoNameCreator().setPrefix(doPrefix); @@ -73,8 +73,9 @@ runVelocity(TEMPLATE_PATH, "action-servlet.xml.vm", srcPath + "/WebContent/WEB-INF/", "action-servlet.xml", context); runVelocity(TEMPLATE_PATH, "web.xml.vm", srcPath + "/WebContent/WEB-INF/", "web.xml", context); runVelocity(TEMPLATE_PATH, "ApplicationResources.properties.vm", srcPath + "/src/", "ApplicationResources.properties", context); - runVelocity(TEMPLATE_PATH, "index.jsp.vm", srcPath + "/WebContent/", "index.jsp", context); - runVelocity(TEMPLATE_PATH, "menu.jsp.vm", srcPath + "/WebContent/WEB-INF/pages", "menu.jsp", context); + runVelocity(TEMPLATE_PATH, "menu.jsp.vm", srcPath + "/WebContent/common", "menu.jsp", context); + runVelocity(TEMPLATE_PATH, "menu2.jsp.vm", srcPath + "/WebContent/WEB-INF/pages", "menu.jsp", context); + runVelocity(TEMPLATE_PATH, "menu-config.xml.vm", srcPath + "/WebContent/WEB-INF/", "menu-config.xml", context); runVelocity(TEMPLATE_PATH, "log4j.properties.vm", srcPath + "/src/", "log4j.properties", context); // unzip appfuse.zip @@ -96,7 +97,7 @@ public void init(String doPrefix, int defaultNameOffset, String srcPath, String pckName) throws Exception { super.init(doPrefix, defaultNameOffset, srcPath, pckName); - plugin = new SpringEJB3AndHibernateDAOAndTestCasesPlugin(); + plugin = new SpringEJB3AndHibernateDAOPlugin(); plugin.init(doPrefix, defaultNameOffset, srcPath + "/src", pckName); } Modified: salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/templates/hibernateejb3dao/abstracthibernatedao.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -138,7 +138,7 @@ @SuppressWarnings("unchecked") public List<T> findByExample(T exampleInstance, String[] excludeProperty) { Criteria crit = getSession().createCriteria(getPersistentClass()); - Example example = Example.create(exampleInstance); + Example example = Example.create(exampleInstance).excludeZeroes().enableLike().ignoreCase(); for (String exclude : excludeProperty) { example.excludeProperty(exclude); } Modified: salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm =================================================================== --- salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/templates/springhibernatedao/springabstracthibernatedao.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -127,7 +127,7 @@ @SuppressWarnings("unchecked") public List<T> findByExample(T exampleInstance, String[] excludeProperty) { Criteria crit = getSession().createCriteria(getPersistentClass()); - Example example = Example.create(exampleInstance); + Example example = Example.create(exampleInstance).excludeZeroes().enableLike().ignoreCase(); for (String exclude : excludeProperty) { example.excludeProperty(exclude); } Modified: salto-db-generator/trunk/templates/springwebapp/ApplicationResources.properties.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/ApplicationResources.properties.vm 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/templates/springwebapp/ApplicationResources.properties.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -1,5 +1,206 @@ # This file has been generated by ${generatorVersion} at $date #foreach($jdoInfo in ${jdoInfos}) -${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}List.title=List of ${jdoInfo.javaClassName}s -#end \ No newline at end of file +${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}List.title=List of ${jdoInfo.javaClassName}s +menu.${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}.title=${jdoInfo.javaClassName} +menu.search.${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}List.title=Search for ${jdoInfo.javaClassName}s +#end + +menu.search.title=Search +menu.add.title=Add + +# The block of messages below are only found in this file. If you'd +# like to override them for other languages, simply add the keys +# to the other resource bundles. +webapp.name=Salto-db Generator (based on AppFuse) +webapp.tagline=Generated by Salto-db Generator v1.0.16 +webapp.version=Version 2.0-m4 +company.name=AppFuse +company.url=http://raibledesigns.com +copyright.year=2003-2007 + +user.status=Logged in as: +user.logout=Logout + +# -- validator errors -- +errors.invalid={0} is invalid. +errors.maxlength={0} can not be greater than {1} characters. +errors.minlength={0} can not be less than {1} characters. +errors.range={0} is not in the range {1} through {2}. +errors.required={0} is a required field. +errors.byte={0} must be an byte. +errors.date={0} is not a date. +errors.double={0} must be an double. +errors.float={0} must be an float. +errors.integer={0} must be a number. +errors.long={0} must be an long. +errors.short={0} must be an short. +errors.creditcard={0} is not a valid credit card number. +errors.email={0} is an invalid e-mail address. +errors.phone={0} is an invalid phone number. +errors.zip={0} is an invalid zip code. + +# -- other errors -- +errors.cancel=Operation cancelled. +errors.detail={0} +errors.general=<strong>The process did not complete. Details should follow.</strong> +errors.token=Request could not be completed. Operation is not in sequence. +errors.none=No error message was found, check your server logs. +errors.password.mismatch=Invalid username and/or password, please try again. +errors.conversion=An error occurred while converting web values to data values. +errors.twofields=The {0} field has to have the same value as the {1} field. +errors.existing.user=This username ({0}) or e-mail address ({1}) already exists. Please try a different username. + +# -- success messages -- +user.added=User information for <strong>{0}</strong> has been added successfully. +user.deleted=User Profile for <strong>{0}</strong> has been deleted successfully. +user.registered=You have successfully registered for access to this application. +user.saved=Your profile has been updated successfully. +user.updated.byAdmin=User information for <strong>{0}</strong> has been successfully updated. +newuser.email.message={0} has created an AppFuse account for you. Your username and password information is below. +reload.succeeded=Reloading options completed successfully. + +# -- error page messages -- +errorPage.title=An error has occurred +errorPage.heading=Yikes! +404.title=Page Not Found +404.message=The page your requested was not found. You might try returning to the <a href="{0}">Main Menu</a>. While you're here, how about a pretty picture to cheer you up? +403.title=Access Denied +403.message=Your current role does not allow you to view this page. Please contact your system administrator if you believe you should have access. In the meantime, how about a pretty picture to cheer you up? + +# -- login -- +login.title=Login +login.heading=Login +login.rememberMe=Remember Me +login.signup=Not a member? <a href="{0}">Signup</a> for an account. +login.passwordHint=Forgot your password? Have your <a href="?" onmouseover="window.status='Have your password hint sent to you.'; return true" onmouseout="window.status=''; return true" title="Have your password hint sent to you." onclick="passwordHint(); return false">password hint e-mailed to you</a>. +login.passwordHint.sent=The password hint for <strong>{0}</strong> has been sent to <strong>{1}</strong>. +login.passwordHint.error=The username <strong>{0}</strong> was not found in our database. + +# -- mainMenu -- +mainMenu.title=Main Menu +mainMenu.heading=Welcome! +mainMenu.message=Congratulations, you have logged in successfully! Now that you've logged in, you have the following options: +mainMenu.activeUsers=Current Users + +# -- menu/link messages -- +menu.admin=Administration +menu.admin.users=View Users +menu.admin.reload=Reload Options + +menu.user=Edit Profile +menu.selectFile=Upload A File +menu.flushCache=Flush Cache +menu.clickstream=Clickstream + +# -- form labels -- +label.username=Username +label.password=Password + +# -- button labels -- +button.add=Add +button.cancel=Cancel +button.copy=Copy +button.delete=Delete +button.done=Done +button.edit=Edit +button.register=Signup +button.save=Save +button.search=Search +button.upload=Upload +button.view=View +button.reset=Reset +button.login=Login + +# -- general values -- +icon.information=Information +icon.information.img=/images/iconInformation.gif +icon.email=E-Mail +icon.email.img=/images/iconEmail.gif +icon.warning=Warning +icon.warning.img=/images/iconWarning.gif +date.format=MM/dd/yyyy + +# -- role form -- +roleForm.name=Name + +# -- user profile page -- +userProfile.title=User Settings +userProfile.heading=User Profile +userProfile.message=Please update your information using the form below. +userProfile.admin.message=You can update this user's information using the form below. +userProfile.showMore=View More Information +userProfile.accountSettings=Account Settings +userProfile.assignRoles=Assign Roles +userProfile.cookieLogin=You cannot change passwords when logging in with the <strong>Remember Me</strong> feature. Please logout and log back in to change passwords. + +# -- user form -- +user.address.address=Address +user.availableRoles=Available Roles +user.address.city=City +user.address.country=Country +user.email=E-Mail +user.firstName=First Name +user.id=Id +user.lastName=Last Name +user.password=Password +user.confirmPassword=Confirm Password +user.phoneNumber=Phone Number +user.address.postalCode=Zip +user.address.province=State +user.roles=Current Roles +user.username=Username +user.website=Website +user.visitWebsite=visit +user.passwordHint=Password Hint +user.enabled=Enabled +user.accountExpired=Expired +user.accountLocked=Locked +user.credentialsExpired=Password Expired + +# -- user list page -- +userList.title=User List +userList.heading=Current Users +userList.nousers=<span>No users found.</span> + +# -- user self-registration -- +signup.title=Sign Up +signup.heading=New User Registration +signup.message=Please enter your user information in the form below. +signup.email.subject=AppFuse Account Information +signup.email.message=You have successfully registered for access to AppFuse. Your username and password information is below. + +# -- upload page messages -- +maxLengthExceeded=The file you are trying to upload is too big. The maximum allowed size is 2 MB. +upload.title=File Upload +upload.heading=Upload A File +upload.message=Note that the maximum allowed size of an uploaded file for this application is 2 MB. +uploadForm.name=Friendly Name +uploadForm.file=File to Upload + +# -- display page messages -- +display.title=File Uploaded Successfully! +display.heading=File Information + +# -- flushCache page -- +flushCache.title=Flush Cache +flushCache.heading=Flush Successful! +flushCache.message=All caches successfully flushed, returning you to your previous page in 2 seconds. + +# -- clickstreams page -- +clickstreams.title=All Clickstreams +clickstreams.heading=All Clickstreams + +# -- viewstream page -- +viewstream.title=Stream Details +viewstream.heading=Stream Information + +# -- active users page -- +activeUsers.title=Active Users +activeUsers.heading=Current Users +activeUsers.message=The following is a list of users that have logged in and their sessions have not expired. +activeUsers.fullName=Full Name + +# JSF-only messages, remove if not using JSF +javax.faces.component.UIInput.REQUIRED=This is a required field. +activeUsers.summary={0} User(s) found, displaying {1} user(s), from {2} to {3}. Page {4} / {5} \ No newline at end of file Modified: salto-db-generator/trunk/templates/springwebapp/action-servlet.xml.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/action-servlet.xml.vm 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/templates/springwebapp/action-servlet.xml.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -15,7 +15,8 @@ </property> </bean> - + <bean id="filenameController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/> + <!-- List controllers --> #foreach($jdoInfo in ${jdoInfos}) <bean id="${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}ListController" class="${pckName}.webapp.controller.${jdoInfo.javaClassName}ListController"> @@ -81,7 +82,8 @@ <prop key="/list${jdoInfo.javaClassName}.html">${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}ListController</prop> #end #foreach($jdoInfo in ${jdoInfos}) - <prop key="/addupdate${jdoInfo.javaClassName}.html">${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}AddUpdateController</prop> + <prop key="/addupdate${jdoInfo.javaClassName}.html">${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}AddUpdateController</prop> + <prop key="/add${jdoInfo.javaClassName}.html">${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}AddUpdateController</prop> #end #foreach($jdoInfo in ${jdoInfos}) <prop key="/delete${jdoInfo.javaClassName}.html">${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}AjaxDeleteController</prop> @@ -89,6 +91,7 @@ #foreach($jdoInfo in ${jdoInfos}) <prop key="/search${jdoInfo.javaClassName}.html">${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}SearchController</prop> #end + <prop key="/mainMenu.html">filenameController</prop> </props> </property> </bean> Modified: salto-db-generator/trunk/templates/springwebapp/editor.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/editor.vm 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/templates/springwebapp/editor.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -8,6 +8,21 @@ #set ($pkEntry="${pk.javaAttName}") #end #end +#set ($pk="Long") +#set ($pkname="") +#foreach($col in ${jdoInfo.jdoColInfos}) +#foreach($colpk in ${jdoInfo.getPk()}) +#if ($colpk.col.equals($col.colName)) +#set ($pk=$util.getClassNameForPrimitive($col.javaAttClass)) +#set ($pkname=$util.getDoNameCreator().attribute2class($col.javaAttName)) +#end +#end +#end +#if ($util.getLength($jdoInfo.getPk()) > 1) +#set ($pk="${jdoInfo.javaClassName}PK") +#set ($pkname="${jdoInfo.javaClassName}PK") +import ${jdoInfo.javaPckName}.pojo.${jdoInfo.javaClassName}.${jdoInfo.javaClassName}PK; +#end /** * <p>PropertyEditorSupport for ${jdoInfo.javaClassName}s</p> @@ -17,10 +32,24 @@ */ public class ${jdoInfo.javaClassName}EditorSupport extends PropertyEditorSupport { + private ${pk} getPkFromString(String text) { +#if ($util.getLength($jdoInfo.getPk()) > 1) + //TODO : get composite of the pk in request and return an instance of ${pk} + return null; +#else +#if ($pk == "Integer") + return Integer.parseInt(text); +#end +#if ($pk == "Long") + return Long.parseLong(text); +#end +#end + } + public void setAsText(String text) throws IllegalArgumentException { ${jdoInfo.javaClassName} ${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})} = new ${jdoInfo.javaClassName}(); - ${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}.set${util.DoNameCreator.attribute2class(${pkEntry})}(Long.valueOf(text)); + ${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}.set${util.DoNameCreator.attribute2class(${pkEntry})}(getPkFromString(text)); setValue(${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}); } Modified: salto-db-generator/trunk/templates/springwebapp/emlist.jsp.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/emlist.jsp.vm 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/templates/springwebapp/emlist.jsp.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -1,26 +1,14 @@ #if ($util.getLength($jdoInfo.pk) > 0) #foreach($pk in $jdoInfo.pk) -#set ($pkEntry="entry.${pk.javaAttName}") +#set ($pkEntry="${pk.javaAttName}") #end #end <c:if test="${ not empty ${jdoInfo.javaClassName}list}"> - <table> - <tr> +<display:table name="${jdoInfo.javaClassName}list" cellspacing="0" cellpadding="0" requestURI="" + defaultsort="1" id="${jdoInfo.javaClassName}" pagesize="25" class="table" export="true"> #foreach($col in ${jdoInfo.nonFKColInfos}) - <th>${col.javaAttName}</th> -#end - <th>Remove</th> - </tr> -<c:forEach items="${${jdoInfo.javaClassName}list}" var="entry"> - <tr> -#foreach($col in ${jdoInfo.nonFKColInfos}) -#set ($val = "entry.${col.javaAttName}") - <td><a href="addupdate${jdoInfo.javaClassName}.html?${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}Id=<c:out value="${${pkEntry}}" />"><c:out value="${${val}}" /></a></td> -#end - <td> - <a href="#" onclick="remove${jdoInfo.javaClassName}(<c:out value="${${pkEntry}})"/>">X</a> - </td> - </tr> -</c:forEach> - </table> + <display:column property="${col.javaAttName}" escapeXml="true" sortable="true" title="${col.javaAttName}" url="/addupdate${jdoInfo.javaClassName}.html" paramId="${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}Id" paramProperty="${pkEntry}"/> +#end + +</display:table> </c:if> \ No newline at end of file Modified: salto-db-generator/trunk/templates/springwebapp/form.jsp.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/form.jsp.vm 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/templates/springwebapp/form.jsp.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -1,29 +1,23 @@ -<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" %> -<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> -<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<%@ include file="/common/taglibs.jsp"%> #if ($util.getLength($jdoInfo.pk) > 0) #foreach($pk in $jdoInfo.pk) #set ($pkEntry="${pk.javaAttName}") #end #end <head> + <title><fmt:message key="menu.${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}.title"/></title> + <content tag="heading"><fmt:message key="menu.${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}.title"/></content> + <meta name="menu" content="${jdoInfo.javaClassName}"/> </head> - <body> -<%@ include file="menu.jsp" %> +<fieldset> <form:form commandName="${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}" action="addupdate${jdoInfo.javaClassName}.html" method="post"> <ul> #foreach($col in ${jdoInfo.nonFKColInfos}) - <li><label for="${col.javaAttName}">${col.javaAttName}</label><form:errors path="${col.javaAttName}" /><span><form:input path="${col.javaAttName}" id="${col.javaAttName}"/></span></li> + <li><label class="desc" for="${col.javaAttName}">${col.javaAttName}</label><form:errors path="${col.javaAttName}" /><span><form:input cssClass="text medium" path="${col.javaAttName}" id="${col.javaAttName}"/></span></li> #end #foreach($colfk in ${jdoInfo.getImportedFk()}) #foreach($colfk2 in $colfk) - <li><label for="${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}">${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}</label> + <li><label class="desc" for="${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}">${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}</label> <form:errors path="${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}" /> <span> <form:select path="${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}" id="${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}"> @@ -35,12 +29,11 @@ #end #end <c:if test="${ empty requestScope['${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}'].$pkEntry}"> - <li><input type="submit" name="add" value="Add" /> <input type="submit" name="cancel" value="Cancel" /></li> + <li><input type="submit" class="button" name="add" value="Add" /> <input class="button" type="submit" name="cancel" value="Cancel" /></li> </c:if> <c:if test="${ not empty requestScope['${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}'].$pkEntry}"> - <li><input type="submit" name="update" value="Update" /> <input type="submit" name="cancel" value="Cancel" /></li> + <li><input type="submit" class="button" name="update" value="Update" /> <input class="button" type="submit" name="cancel" value="Cancel" /></li> </c:if> </ul> </form:form> - </body> -</html> \ No newline at end of file +</fieldset> \ No newline at end of file Deleted: salto-db-generator/trunk/templates/springwebapp/index.jsp.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/index.jsp.vm 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/templates/springwebapp/index.jsp.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -1,16 +0,0 @@ -<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" %> -<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> -<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> - <head> - </head> - <body> - This webapp has been generated by ${generatorVersion} at $date. -<%@ include file="/WEB-INF/pages/menu.jsp" %> - </body> -</html> \ No newline at end of file Modified: salto-db-generator/trunk/templates/springwebapp/list.jsp.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/list.jsp.vm 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/templates/springwebapp/list.jsp.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -1,15 +1,8 @@ -<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" %> -<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> -<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<%@ include file="/common/taglibs.jsp"%> <head> <title><fmt:message key="${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}List.title"/></title> - </head> + <content tag="heading"><fmt:message key="${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}List.title"/></content> + <script language="javascript"> function remove${jdoInfo.javaClassName}(id) @@ -19,9 +12,5 @@ } </script> - <body> -<%@ include file="menu.jsp" %> - <h1>List of ${jdoInfo.javaClassName}s</h1> -<%@ include file="${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}EmList.jsp" %> - </body> -</html> \ No newline at end of file + </head> +<%@ include file="${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}EmList.jsp" %> \ No newline at end of file Added: salto-db-generator/trunk/templates/springwebapp/menu-config.xml.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/menu-config.xml.vm (rev 0) +++ salto-db-generator/trunk/templates/springwebapp/menu-config.xml.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<MenuConfig> + <Displayers> + <Displayer name="Velocity" type="net.sf.navigator.displayer.VelocityMenuDisplayer"/> + </Displayers> + <Menus> + +#foreach($jdoInfo in ${jdoInfos}) + <Menu name="${jdoInfo.javaClassName}" title="menu.${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}.title"> + <Item name="${jdoInfo.javaClassName}List" title="${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}List.title" page="/list${jdoInfo.javaClassName}.html"/> + <Item name="${jdoInfo.javaClassName}Search" title="menu.search.${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}List.title" page="/search${jdoInfo.javaClassName}.html"/> + <Item name="${jdoInfo.javaClassName}Add" title="menu.add.title" page="/add${jdoInfo.javaClassName}.html"/> + </Menu> + +#end + </Menus> +</MenuConfig> \ No newline at end of file Modified: salto-db-generator/trunk/templates/springwebapp/menu.jsp.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/menu.jsp.vm 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/templates/springwebapp/menu.jsp.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -1,9 +1,10 @@ -<div id="menu"> - <ul> +<%@ include file="/common/taglibs.jsp"%> + +<menu:useMenuDisplayer name="Velocity" config="WEB-INF/classes/cssHorizontalMenu.vm"> +<ul id="primary-nav" class="menuList"> + <li class="pad"> </li> #foreach($jdoInfo in ${jdoInfos}) - <li><a href="addupdate${jdoInfo.javaClassName}.html">Add a ${jdoInfo.javaClassName}</a></li> - <li><a href="list${jdoInfo.javaClassName}.html">List ${jdoInfo.javaClassName}s</a></li> - <li><a href="search${jdoInfo.javaClassName}.html">Search ${jdoInfo.javaClassName}s</a></li> -#end - </ul> -</div> \ No newline at end of file + <menu:displayMenu name="${jdoInfo.javaClassName}"/> +#end +</ul> +</menu:useMenuDisplayer> \ No newline at end of file Added: salto-db-generator/trunk/templates/springwebapp/menu2.jsp.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/menu2.jsp.vm (rev 0) +++ salto-db-generator/trunk/templates/springwebapp/menu2.jsp.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -0,0 +1,23 @@ +<%@ include file="/common/taglibs.jsp"%> + +<menu:useMenuDisplayer name="Velocity" config="WEB-INF/classes/cssHorizontalMenu.vm"> +<ul id="primary-nav" class="menuList"> + <li class="pad"> </li> +#foreach($jdoInfo in ${jdoInfos}) + <menu:displayMenu name="${jdoInfo.javaClassName}"/> +#end +</ul> +</menu:useMenuDisplayer> + +<script type="text/javascript"> +/*<![CDATA[*/ +var navItems = document.getElementById("primary-nav").getElementsByTagName("li"); + +for (var i=0; i<navItems.length; i++) { + if(navItems[i].className == "menubar") { + navItems[i].onmouseover=function() { this.className += " over"; } + navItems[i].onmouseout=function() { this.className = "menubar"; } + } +} +/*]]>*/ +</script> \ No newline at end of file Modified: salto-db-generator/trunk/templates/springwebapp/searchform.jsp.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/searchform.jsp.vm 2007-04-06 14:28:11 UTC (rev 279) +++ salto-db-generator/trunk/templates/springwebapp/searchform.jsp.vm 2007-04-09 18:13:33 UTC (rev 280) @@ -1,30 +1,24 @@ -<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" %> -<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> -<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> -<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> -<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<%@ include file="/common/taglibs.jsp"%> #if ($util.getLength($jdoInfo.pk) > 0) #foreach($pk in $jdoInfo.pk) #set ($pkEntry="${pk.javaAttName}") #end #end <head> + <title><fmt:message key="menu.search.${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}List.title"/></title> + <content tag="heading"><fmt:message key="menu.search.${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}List.title"/></content> + <meta name="menu" content="${jdoInfo.javaClassName}"/> </head> - <body> -<%@ include file="menu.jsp" %> - <h1>Search ${jdoInfo.javaClassName}s</h1> + +<fieldset> <form:form commandName="${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}" action="search${jdoInfo.javaClassName}.html" method="post"> <ul> #foreach($col in ${jdoInfo.nonFKColInfos}) - <li><label for="${col.javaAttName}">${col.javaAttName}</label><form:errors path="${col.javaAttName}" /><span><form:input path="${col.javaAttName}" id="${col.javaAttName}"/></span></li> + <li><label class="desc" for="${col.javaAttName}">${col.javaAttName}</label><form:errors path="${col.javaAttName}" /><span><form:input cssClass="text medium" path="${col.javaAttName}" id="${col.javaAttName}"/></span></li> #end #foreach($colfk in ${jdoInfo.getImportedFk()}) #foreach($colfk2 in $colfk) - <li><label for="${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}">${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}</label> + <li><label class="desc" for="${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}">${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}</label> <form:errors path="${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}" /> <span> <form:select path="${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}" id="${util.DoNameCreator.class2attribute(${colfk2.pkJavaClassName})}"> @@ -35,9 +29,8 @@ </li> #end #end - <li id="buttons"><input type="submit" name="search" value="Search" /></li> + <li id="buttons"><input class="button" type="submit" name="search" value="Search" /></li> </ul> </form:form> -<%@ include file="${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}EmList.jsp" %> - </body> -</html> \ No newline at end of file +</fieldset> +<%@ include file="${util.DoNameCreator.class2attribute(${jdoInfo.javaClassName})}EmList.jsp" %> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Michal C. <ca...@ya...> - 2007-04-09 17:44:52
|
Hello, While I was playing with my own generator I had problems with using it in ant. The problem was with classloader - if you don't specify to use the same loader for tasks then the salto generator task will not use previously loaded custom plugin using salto register task. Here is a problemmatic example: <taskdef name="salto-db-generate" classname="com.salto.db.ant.DOGeneratorTask" classpathref="lib.path" /> <taskdef name="salto-db-register" classname="com.salto.db.ant.RegisterPluginTask" classpathref="lib.path" /> <target name="generate"> <salto-db-register className="MyPlugin"/> <salto-db-generate plugin="myPluging" schema="${schema}" tableName="${tableName}" login="${login}" password="${password}" jdbcUrl="${jdbcUrl}" driverClassName="${driverClassName}" outputDir="${outputDir}" packageName="${packageName}"/> </target> Here is the solution: <taskdef name="salto-db-generate" classname="com.salto.db.ant.DOGeneratorTask" classpathref="lib.path" loaderref="lib.path.loader" /> <taskdef name="salto-db-register" classname="com.salto.db.ant.RegisterPluginTask" classpathref="lib.path" loaderref="lib.path.loader" /> <target name="generate"> <salto-db-register className="MyPlugin"/> <salto-db-generate plugin="myPluging" schema="${schema}" tableName="${tableName}" login="${login}" password="${password}" jdbcUrl="${jdbcUrl}" driverClassName="${driverClassName}" outputDir="${outputDir}" packageName="${packageName}"/> </target> Thanks, Michal ____________________________________________________________________________________ Never miss an email again! Yahoo! Toolbar alerts you the instant new Mail arrives. http://tools.search.yahoo.com/toolbar/features/mail/ |
From: <rfl...@la...> - 2007-04-07 14:08:04
|
Hello, Sorry I always forget to release files on sourceforge, I only update the eclipse plugin... Anyway, I've just uploaded salto-db-generator-1.0.15.jar, which should contain everything you need. Regards, Rémi. Michal Cabak a écrit : > Hello, > > I was going to play with salto generator (to write my own plugin) but I couldn't find core classes (f.e. DefaultAbstractGeneratorPlugin) in release jars. I downloaded all possible files from sourceforge (f.e. salto-db-1.0.0.jar ) and couldn't find them. > > Please advise > > Thanks, > Michal > > > > > > ____________________________________________________________________________________ > Bored stiff? Loosen up... > Download and play hundreds of games for free on Yahoo! Games. > http://games.yahoo.com/games/front > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Salto-db-devs mailing list > Sal...@li... > https://lists.sourceforge.net/lists/listinfo/salto-db-devs > |
From: Michal C. <ca...@ya...> - 2007-04-07 12:17:18
|
Hello, I was going to play with salto generator (to write my own plugin) but I couldn't find core classes (f.e. DefaultAbstractGeneratorPlugin) in release jars. I downloaded all possible files from sourceforge (f.e. salto-db-1.0.0.jar ) and couldn't find them. Please advise Thanks, Michal ____________________________________________________________________________________ Bored stiff? Loosen up... Download and play hundreds of games for free on Yahoo! Games. http://games.yahoo.com/games/front |
From: <rfl...@us...> - 2007-04-06 14:28:24
|
Revision: 279 http://svn.sourceforge.net/salto-db/?rev=279&view=rev Author: rflament Date: 2007-04-06 07:28:11 -0700 (Fri, 06 Apr 2007) Log Message: ----------- Modified Paths: -------------- salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java salto-db-generator/trunk/templates/springwebapp/web.xml.vm Added Paths: ----------- salto-db-generator/trunk/src/appfuse.zip salto-db-generator/trunk/src/com/salto/db/generator/ZipUtil.java Added: salto-db-generator/trunk/src/appfuse.zip =================================================================== (Binary files differ) Property changes on: salto-db-generator/trunk/src/appfuse.zip ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: salto-db-generator/trunk/src/com/salto/db/generator/ZipUtil.java =================================================================== --- salto-db-generator/trunk/src/com/salto/db/generator/ZipUtil.java (rev 0) +++ salto-db-generator/trunk/src/com/salto/db/generator/ZipUtil.java 2007-04-06 14:28:11 UTC (rev 279) @@ -0,0 +1,51 @@ +package com.salto.db.generator; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +public final class ZipUtil { + + /** + * @param stream + * @throws IOException + */ + public static void unzip(InputStream stream, String directory) throws IOException { + InputStream in = new BufferedInputStream(stream); + ZipInputStream zin = new ZipInputStream(in); + ZipEntry e; + + while ((e = zin.getNextEntry()) != null) { + + if (!e.isDirectory()) { + + System.out.println("unzipping " + directory + e.getName()); + unzipAFile(zin, directory + e.getName()); + } + } + zin.close(); + + } + + public static void unzipAFile(ZipInputStream zin, String s) throws IOException { + + File file = new File(s); + if (!new File(file.getParent()).exists()) { + new File(file.getParent()).mkdirs(); + } + + FileOutputStream out = new FileOutputStream(s); + byte[] b = new byte[4096]; + int len = 0; + while ((len = zin.read(b)) != -1) { + out.write(b, 0, len); + } + out.close(); + + } + +} Modified: salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java =================================================================== --- salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java 2007-04-05 14:12:32 UTC (rev 278) +++ salto-db-generator/trunk/src/com/salto/db/generator/plugin/SpringWebappPlugin.java 2007-04-06 14:28:11 UTC (rev 279) @@ -4,11 +4,12 @@ import java.util.HashMap; import java.util.Map; -import com.salto.db.generator.Constants; - import salto.tool.jdo.data.JdoInfo; import salto.tool.jdo.util.CreatorUtil; +import com.salto.db.generator.Constants; +import com.salto.db.generator.ZipUtil; + /** * @author rfl...@sa... * @@ -43,7 +44,6 @@ runVelocity(TEMPLATE_PATH, "editor.vm", srcPath + "/src/" + (pckName + ".webapp.editor").replace('.', '/') + "/", className + "EditorSupport.java", context); - runVelocity(TEMPLATE_PATH, "emlist.jsp.vm", srcPath + "/WebContent/WEB-INF/pages", CreatorUtil.getDoNameCreator().class2attribute(className) + "EmList.jsp", context); runVelocity(TEMPLATE_PATH, "list.jsp.vm", srcPath + "/WebContent/WEB-INF/pages", CreatorUtil.getDoNameCreator().class2attribute(className) + "List.jsp", context); @@ -77,6 +77,9 @@ runVelocity(TEMPLATE_PATH, "menu.jsp.vm", srcPath + "/WebContent/WEB-INF/pages", "menu.jsp", context); runVelocity(TEMPLATE_PATH, "log4j.properties.vm", srcPath + "/src/", "log4j.properties", context); + // unzip appfuse.zip + ZipUtil.unzip(this.getClass().getClassLoader().getResourceAsStream("appfuse.zip"), srcPath + "/"); + } public String getLongDescription() { Modified: salto-db-generator/trunk/templates/springwebapp/web.xml.vm =================================================================== --- salto-db-generator/trunk/templates/springwebapp/web.xml.vm 2007-04-05 14:12:32 UTC (rev 278) +++ salto-db-generator/trunk/templates/springwebapp/web.xml.vm 2007-04-06 14:28:11 UTC (rev 279) @@ -1,10 +1,16 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" - "http://java.sun.com/dtd/web-app_2_3.dtd"> +<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> + <!-- This file has been generated by ${generatorVersion} at $date --> -<web-app> - <display-name>Salto-db Generator Spring webapp</display-name> + + <display-name>Spring Webapp generated by Salto-db Generator</display-name> + <distributable/> + <context-param> + <param-name>csstheme</param-name> + <param-value>andreas01</param-value> + </context-param> <context-param> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> <param-value>ApplicationResources</param-value> @@ -15,9 +21,14 @@ </context-param> <context-param> <param-name>contextConfigLocation</param-name> - <param-value>/WEB-INF/applicationContext-*.xml</param-value> + <param-value> + classpath*:/applicationContext-*.xml + /WEB-INF/applicationContext*.xml + </param-value> </context-param> + + <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> @@ -31,6 +42,14 @@ </init-param> </filter> <filter> + <filter-name>exportFilter</filter-name> + <filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class> + </filter> + <filter> + <filter-name>sitemesh</filter-name> + <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> + </filter> + <filter> <filter-name>hibernateFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> </filter> @@ -43,11 +62,20 @@ <filter-name>encodingFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> - + <filter-mapping> + <filter-name>exportFilter</filter-name> + <url-pattern>*.html</url-pattern> + </filter-mapping> <filter-mapping> <filter-name>hibernateFilter</filter-name> <url-pattern>*.html</url-pattern> </filter-mapping> + <filter-mapping> + <filter-name>sitemesh</filter-name> + <url-pattern>/*</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + </filter-mapping> <listener> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> @@ -56,6 +84,10 @@ <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> + + <listener> + <listener-class>net.sf.navigator.menu.MenuContextListener</listener-class> + </listener> <servlet> <servlet-name>action</servlet-name> @@ -74,7 +106,7 @@ <welcome-file-list> <welcome-file>index.jsp</welcome-file> - </welcome-file-list> + </welcome-file-list> </web-app> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |