text
stringlengths
3
1.18M
package anni.tools; import java.util.*; public class Bean { public String tableName; public String type; public List<Row> rowList = new ArrayList<Row>(); public Bean(String tableName) { this.tableName = tableName; } public List<Row> getRowList() { return rowLi...
package anni.tools; import java.io.*; import java.lang.reflect.*; //import java.text.*; import java.util.*; import freemarker.template.*; import jxl.*; import java.lang.annotation.*; import java.lang.reflect.*; import java.util.*; import javax.persistence.*; import org.hibernate.annotations.GenericGenera...
package anni.tools; import java.io.*; import java.util.*; import jxl.*; public class ExcelUtils { public static List<Bean> read(String xls) throws Exception { return read(new File(xls)); } public static List<Bean> read(File file) throws Exception { Workbook workbook = Workbo...
package anni.tools; import java.lang.annotation.*; import java.lang.reflect.*; import java.util.*; import javax.persistence.*; import org.hibernate.annotations.GenericGenerator; public class DomainUtils { public static String prefix = ""; public String createEntity(Class pojo) { Annotat...
package anni.tools; import java.io.*; import java.util.*; import jxl.*; import java.text.*; @SuppressWarnings("unchecked") public class GenDao { static String rootPackage; static String daoPackage; static String hibernatePackage; static String domainPackage; static String webPackage...
package anni.tools; import java.io.*; import java.util.*; import jxl.*; import java.text.*; import freemarker.template.*; @SuppressWarnings("unchecked") public class GenManager { static String rootPackage; static String daoPackage; static String hibernatePackage; static String domainPac...
package anni.tools; import java.io.*; import java.sql.*; import java.util.*; import org.dbunit.database.*; import org.dbunit.dataset.*; import org.dbunit.dataset.excel.*; public class DbUnitUtils { public static void genDbUnitExcel(String dest) throws Exception { // hsqldb Class.forN...
package anni.tools; import java.io.*; import java.util.*; import jxl.*; @SuppressWarnings("unchecked") public class GenHsqldb { static String inputFileName = null; static String outputFileName = null; static String prefix = null; static List foreignKey = new ArrayList(); /** * 根据...
package anni.tools; public class Row { public String name; public String type; public String notNull; public String defaultValue; public String desc; public String pk; public String fk; public String getDesc() { return desc; } // transient public ...
import java.io.*; import java.util.*; import de.hunsicker.jalopy.storage.*; public class JalopyUtil { public static void main(String[] args) throws Exception { // System.out.println(System.currentTimeMillis()); if (args.length < 1) { args = new String[]{"C:/Documents and Settings/Adminis...
import java.sql.Connection; import java.sql.DriverManager; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.File; import org.dbunit.database.DatabaseConnection; import org.dbunit.database.IDatabaseConnection; import org.dbunit.dataset.IDataSet; import org.dbunit.dataset.excel....
package anni.core.search.compass; import java.util.HashSet; import java.util.Set; import org.apache.commons.lang.StringUtils; import org.compass.core.CompassQuery.SortDirection; import org.compass.core.CompassQuery.SortPropertyType; import org.compass.core.support.search.CompassSearchCommand; //import or...
package anni.core.search.compass; import org.apache.log4j.Logger; import org.compass.gps.CompassGps; import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; /** * 自动随Spring ApplicationContext启动而重建索引的Builder. * 会启动后延时数秒新开线程调用compassGps.index()函数. * 默认会在We...
package anni.core.search.compass; import org.compass.core.Compass; import org.compass.core.CompassHits; import org.compass.core.CompassSession; import org.compass.core.support.search.CompassSearchCommand; import org.compass.core.support.search.CompassSearchHelper; /** * @author <a href="mailto:rory.cn@gma...
package anni.core.search.compass; import anni.core.search.compass.AdvancedSearchCommand.CompassSort; import org.compass.core.Compass; import org.compass.core.CompassCallback; import org.compass.core.CompassDetachedHits; import org.compass.core.CompassHits; import org.compass.core.CompassQuery; import org.com...
package anni.core.mock.db.manager; import anni.core.dao.ECHibernateEntityDao; import anni.core.mock.db.domain.Dictionary; /** * @author Lingo. * @since 2007年07月11日 下午 22时14分52秒984 */ public class DictionaryManager extends ECHibernateEntityDao<Dictionary> { }
package anni.core.mock.db.manager; import anni.core.dao.ECHibernateEntityDao; import anni.core.mock.db.domain.Category; /** * @author Lingo. * @since 2007年07月11日 下午 22时14分52秒984 */ public class CategoryManager extends ECHibernateEntityDao<Category> { }
package anni.core.mock.db.web; import anni.core.mock.db.domain.Dictionary; import anni.core.mock.db.manager.DictionaryManager; import anni.core.web.prototype.BaseLongController; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * @author Lingo. * @since 2007年07...
package anni.core.mock.db.web; import anni.core.web.prototype.ExtendController; /** * @author Lingo. * @since 2007年07月11日 下午 22时15分06秒578 */ public class AdminController extends ExtendController { /** * 后台首页. */ public void index() { } /** * 后台上端菜单. */ p...
package anni.core.mock.db.web; import anni.core.mock.db.domain.Category; import anni.core.mock.db.manager.CategoryManager; import anni.core.web.prototype.BaseLongController; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * @author Lingo. * @since 2007年07月11日...
package anni.core.mock.db.hibernate; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.*; import java.util.ArrayList; import java.util.Collection; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory...
package anni.core.mock.db.hibernate; import java.io.Serializable; import java.sql.Connection; import java.util.Map; import java.util.Set; import javax.naming.NamingException; import javax.naming.Reference; import org.hibernate.HibernateException; import org.hibernate.Interceptor; import org.hibernate...
package anni.core.mock.db.hibernate; import java.io.PrintWriter; import java.sql.Connection; import java.sql.SQLException; import javax.sql.DataSource; public class MockDataSource implements DataSource { public Connection getConnection() throws SQLException { return null; } publ...
package anni.core.mock.db.hibernate; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.FlushMode; public class ProxyHelper implements Invo...
package anni.core.mock.db.hibernate; import java.io.Serializable; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List;...
package anni.core.mock.db.hibernate; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFact...
package anni.core.mock.db.hibernate; import java.beans.*; import java.io.*; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hibernate.SessionFactory; i...
package anni.core.mock.db.domain; // Generated 2007-7-11 22:14:50 by Hibernate Tools 3.2.0.b9 import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence...
package anni.core.test; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.InputStreamReader; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import java.util.Properties; import org.apache.commons.configuration.ConfigurationException; imp...
package anni.core.test; import com.thoughtworks.selenium.DefaultSelenium; import com.thoughtworks.selenium.Selenium; import junit.framework.TestCase; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.PropertiesConfiguration; import org.openqa.selenium....
package anni.core.test; import org.springframework.test.web.AbstractModelAndViewTests; import org.springframework.web.servlet.ModelAndView; /** * 调用AbstractModelAndViewTests的工具类,提供一些简便测试ModelAndView的方法. * * @author Lingo * @since 2007-06-01 * @version 1.0 */ public class ModelAndViewTestHelper e...
package anni.core.test; import org.springframework.test.AbstractTransactionalDataSourceSpringContextTests; /** * 使用DbUnit和spring测试hibernate3的dao. * * @since 2007-03-19 */ public class AbstractDaoTestCase extends AbstractTransactionalDataSourceSpringContextTests { /** * DbUnit工具类. ...
package anni.core.test; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import org.hsqldb.Server; /** * 启动关闭hsqldb的工具类. * * @author Lingo * @since 2007-06-01 * @version 1.0 */ public final class HsqldbHelper { /** ...
package anni.core.menu; import java.io.IOException; import java.text.MessageFormat; import java.util.List; import java.util.Map; import javax.servlet.jsp.JspException; import javax.servlet.jsp.PageContext; import net.sf.navigator.displayer.AbstractMenuDisplayer; import net.sf.navigator.displayer.MenuD...
package anni.core.dao.undelete; /** * 装载Entity信息的内部类. * * @author calvin */ public class EntityInfo { private boolean isUndeletable = false; // entity是否undeleteable的标志 private String statusProperty; // 标识状态的属性名 public EntityInfo(Class entityClass) { init(entityClass); } ...
package anni.core.dao.undelete; /** * 标识商业对象不能被删除,只能被设为无效的接口. * * @author calvin */ public interface UndeletableEntity { void setStatus(String status); }
package anni.core.dao.undelete; import java.util.List; import org.hibernate.criterion.Criterion; /** * 定义如果支持Entity不被直接删除必须支持的Operation. * * @author calvin */ public interface UndeleteableEntityOperation<T> { /* * Undelete Entity用到的几个常量,因为要同时兼顾Interface与Annotation,所以集中放此. */ St...
package anni.core.dao.undelete; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * 标识商业对象不能被删除,只能被设为无效的Annoation. * <p/> * 相比inferface的标示方式,annotation 方式更少侵入性,可以定义任意属性代表status,而默认为status属性....
package anni.core.dao.ibatis; import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.util.List; import anni.core.dao.support.Page; import anni.core.utils.GenericsUtils; import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.lang.StringUtils;...
package anni.core.dao.ibatis; import java.io.Serializable; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import java.util.List; import java.util.Map; import anni.core.dao.support.Page; import com.ibatis.common.util.PaginatedList; imp...
package anni.core.dao; import java.util.List; import anni.core.domain.NamedEntityBean; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * 实现Named实体类操作的hibernate实现. * * @author Lingo * @since 2007-06-06 * @param <T> Named实体类 */ public class HibernateNam...
package anni.core.dao; import java.util.List; import anni.core.domain.tree.TreeEntityBean; /** * 专门对实现了TreeEntityBean进行操作的dao接口. * * @author Lingo * @since 2007-06-06 * @param <T> 树形实体类 */ public interface TreeEntityDao<T extends TreeEntityBean> extends NamedEntityDao<T> { /** * ...
package anni.core.dao; import anni.core.domain.NamedEntityBean; /** * 专门对实现了NamedEntityBean进行操作的dao接口. * * @author Lingo * @since 2007-06-06 * @param <T> Named实体类 */ public interface NamedEntityDao<T extends NamedEntityBean> extends EntityDao<T> { /** * 如果数据库中不存在指定name的记录,就将此条记录插入数据...
package anni.core.dao; import java.io.Serializable; import java.util.List; import java.util.Map; import java.util.Set; import anni.core.dao.hibernate.HibernateEntityDao; import anni.core.dao.support.Page; import anni.core.utils.GenericsUtils; import org.hibernate.Query; import org.springframework.o...
package anni.core.dao.support; import java.io.Serializable; import java.util.ArrayList; /** * 分页对象. 包含当前页数据及分页信息如总记录数. * 来自www.springside.org.cn * * @author ajax * @author calvin * @since 2007-03-30 * @version 1.0 */ public class Page implements Serializable { /** * 持久化. */ ...
package anni.core.dao.hibernate; import java.io.Serializable; import java.util.Collection; import java.util.List; import anni.core.utils.GenericsUtils; import org.hibernate.Criteria; import org.hibernate.criterion.Criterion; /** * 负责为单个Entity对象提供CRUD操作的Hibernate DAO基类. * <p/> * 子类只要在类定义时指定所管理...
package anni.core.dao.hibernate; import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import anni.core.dao.support.Page; import a...
package anni.core.dao.audit; /** * 领域对象自动保存修改历史记录的接口. * Hibernate的Event Listener将对实现了此接口的领域对象自动保存修改记录 * 因为继承于{@link AuditableEntity},因此可轻松获得修改人及修改时间 * * @author calvin */ public interface HistorizableEntity extends AuditableEntity { }
package anni.core.dao.audit; import java.util.Date; import org.hibernate.event.PostUpdateEvent; import org.hibernate.event.PostUpdateEventListener; /** * 侦听领域对象的PostUpdate事件,如果此对象实现了HistorizableEntity接口,将记录其修改前后的数据. * (todo:此类未完成) * * @author calvin */ public class HistoryEventListener implements...
package anni.core.dao.audit; /** * 统一的User接口. * 用于AuditableEntity记录修改人的,无论在项目中使用了什么样的user类, * 只要实现了此接口,就可以统一的方式获得操作员loginID * * @author calvin */ public interface IUser { public String getLoginid(); }
package anni.core.dao.audit; import java.util.Date; /** * 领域对象记录创建,修改时间及创建,修改人的接口. * 记录上述信息是领域对象比较通用的需求. * {@link anni.core.web.prototype.ExtendController#bindObject(javax.servlet.http.HttpServletRequest, Object)}会对实现了此接口的领域对象自动从session中取出session 作create/modify User * * ** * * 为AuditableEntity接...
package anni.core.dao; import java.io.Serializable; import java.util.List; import java.util.Map; import anni.core.dao.support.Page; /** * 针对单个Entity对象的操作定义.不依赖于具体ORM实现方案. * 来自www.springside.org.cn * * @author calvin * @since 2007-03-30 * @version 1.0 * @param <T> 实体类 */ public interface ...
package anni.core.dao; import java.util.List; import java.util.Map; import anni.core.dao.hibernate.HibernateEntityDao; import anni.core.dao.undelete.EntityInfo; import anni.core.dao.undelete.UndeleteableEntityOperation; import org.apache.commons.beanutils.PropertyUtils; import org.hibernate.Criteria; ...
package anni.core.dao; import java.util.List; import anni.core.domain.tree.TreeEntityBean; /** * 实现Named实体类操作的hibernate实现. * * @author Lingo * @since 2007-06-06 * @param <T> Named实体类 */ public class HibernateTreeEntityDao<T extends TreeEntityBean<T>> extends HibernateNamedEntityDao<T> imple...
package anni.core.web.filter; import java.io.IOException; import java.util.List; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.filter.OncePerRequestFilter...
package anni.core.web.freemarker; import java.util.Iterator; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import freemarker.ext.jsp.TaglibFactory; import freemarker.ext.servlet.FreemarkerServlet; ...
package anni.core.web.freemarker; import java.io.IOException; import freemarker.template.Configuration; import freemarker.template.ObjectWrapper; import freemarker.template.TemplateException; import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; /** * 把freemarker使用的ObjectWrapper...
package anni.core.web.freemarker; import javax.servlet.ServletContext; import freemarker.ext.jsp.TaglibFactory; import org.springframework.beans.factory.config.AbstractFactoryBean; import org.springframework.web.context.ServletContextAware; /** * @version $Id: TaglibFactoryBean.java,v 1.1 2005/07/04 ...
package anni.core.web.freemarker; import freemarker.ext.jsp.TaglibFactory; import freemarker.ext.servlet.ServletContextHashModel; import org.springframework.web.servlet.view.AbstractTemplateViewResolver; import org.springframework.web.servlet.view.AbstractUrlBasedView; /** * @since 2007-04-17. */ pu...
package anni.core.web.freemarker; import java.util.Enumeration; import java.util.Hashtable; import javax.servlet.GenericServlet; import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletRe...
package anni.core.web.prototype; import java.io.Serializable; import java.util.Locale; import java.util.Map; import anni.core.dao.EntityDao; import anni.core.dao.support.Page; import anni.core.utils.GenericsUtils; import org.apache.commons.lang.StringUtils; import org.extremecomponents.table.limit.L...
package anni.core.web.prototype; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.Ht...
package anni.core.web.prototype; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import anni.core.dao.support.Page; import org.extremecomponents.table.context.Context; import org.extremecomponents.table.context.HttpServletRequestContext; import org.extremecom...
package anni.core.web.prototype; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.View; /** * 不需要使用模板渲染的时候,就可以用这个view来避免spring抛出异常. * * @author Lingo * @since 2007-06-05 */ public class Str...
package anni.core.web.prototype; import java.beans.PropertyEditorSupport; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; /** * 为了支持commons-validator而增加的工具类. * 之所以会有这个类,是因为一个很。。。。说不清楚的东西。 * * 本来我想按照springside中的做法,在客户端和服务器端都用...
package anni.core.web.prototype; /* * Copyright 2002-2006 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/lic...
/* * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requi...
package anni.core.web.prototype; import java.io.Serializable; import anni.core.dao.EntityDao; /** * 专门用于primary key为long情况的BaseController. * * @author Lingo * @since 2007-06-22 */ public class BaseIntController<T, D extends EntityDao<T>> extends BaseController<T, D> { /** * @return...
package anni.core.web.prototype; import java.io.Serializable; import java.util.Map; import javax.servlet.http.HttpServletRequest; import anni.core.dao.TreeEntityDao; import anni.core.domain.tree.TreeEntityBean; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; im...
package anni.core.web.prototype; import java.io.Serializable; import anni.core.dao.EntityDao; /** * 专门用于primary key为long情况的BaseController. * * @author Lingo * @since 2007-06-22 */ public class BaseLongController<T, D extends EntityDao<T>> extends BaseController<T, D> { /** * @retur...
/* * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requi...
package anni.core.web.json; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import net.sf.json.JSONObject; import net.sf.json.JsonConfig; import net.sf.json.processors.JsonValueProcessor; /** * @author Lingo * @since 2007-08-02 */ public class DateJsonValue...
package anni.core.web.listener; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import or...
package anni.core.web.taglib; import java.util.Locale; /** * Html utils for working with tag's names and attributes. * 来自http://jodd.sourceforge.net * * @author najgor@users.sourceforge.net * @author Lingo * @since 2007-03-17 * @version 1.0 */ public final class HtmlUtil { /** * 工具类的...
package anni.core.web.taglib; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; /** * Encodes text strings and URLs to be HTML-safe. * 来自http://jodd.sourceforge.net * * @author najgor@users.sourceforge.net * @author Lingo * @since 2007-03-17 *...
package anni.core.web.taglib; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Locale; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagex...
package anni.core.utils; import java.text.*; import java.util.*; public class DateUtils { private static SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd"); private static SimpleDateFormat customerFormat = new SimpleDateFormat( "yyyyMMdd"); public sta...
package anni.core.utils; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Generics的util类. * 来自www.springside.org.cn * * @author sshwsfc * @since 2007-03-14 * @version 1.0 */ p...
package anni.core.utils; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Iterator; import javax.imageio.ImageIO; import javax.imageio.ImageReader; import javax.imageio.stream.I...
package anni.core.utils; import java.security.*; import java.security.spec.*; /** * md5摘要. * * @author Lingo * @since 2007-06-29 */ public class Md5Utils { public static final String md5(String s) { char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',...
package anni.core.utils; public class StringUtils { public static boolean notEmpty(String str) { return (str != null) && (str.length() != 0); } }
package anni.core.utils; import java.math.BigDecimal; /** * 提供高精度的运算支持. * 所以函数以double为参数类型,兼容int与float. * * @author calvin */ public class NumberUtils { protected NumberUtils() { } /** * 解析字符串. */ public static int str2Int(String str, int defaultValue) { try { ...
package anni.core.utils; import javax.servlet.http.HttpServletRequest; /** * @author calvin */ public class WebUtils { private WebUtils() { } /** * 重载Spring WebUtils中的函数,作用如函数名所示 加入泛型转换,改变输入参数为request 而不是session * * @param name session中变量名称 * @param clazz session中变...
package anni.core.utils; import java.util.Map; /** * 用ThreadLocal提供一个存储线程内变量的地方. * <p/> * 客户端代码可以用静态方法存储和获取线程内变量,不需要依赖于HttpSession. * web层的Controller可通过此处向business层传入user_id之类的变量 * * @author calvin */ @SuppressWarnings("unchecked") public class UserSession { private static final ThreadLocal...
package anni.core.utils; import java.text.*; import java.util.*; public class XTreeUtils { public static final MessageFormat TREE = new MessageFormat( "var {0}{2} = new WebFXTree(\"{3}\", \"javascript:{1}(''{2}'', ''{4}'', {5}, ''{3}'', ''{6}'', ''{7}'', ''{8}'')\");\n" + "xtre...
package anni.core.utils; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.util.As...
package anni.core.domain; import javax.persistence.Column; import javax.persistence.MappedSuperclass; /** * id是String的Named类实现. * * @author Lingo * @since 2007-06-05 */ @MappedSuperclass public class StringNamedEntityBean extends StringEntityBean implements NamedEntityBean { /** * name. *...
package anni.core.domain; import java.io.Serializable; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.MappedSuperclass; /** * 实体类. * 默认实现了id, Serializable接口和equals(), hashCode()方法的超类 * 2007-06-05 * 使用Serializa...
package anni.core.domain; import javax.persistence.Column; import javax.persistence.MappedSuperclass; /** * id是Integer的Named类实现. * * @author Lingo * @since 2007-06-05 */ @MappedSuperclass public class IntegerNamedEntityBean extends IntegerEntityBean implements NamedEntityBean { /** * name...
package anni.core.domain; import java.io.Serializable; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.MappedSuperclass; /** * 实体类. * 默认实现了id, Serializable接口和equals(), hashCode()方法的超类 * * @author Lingo * @sin...
package anni.core.domain.tree; /** * tree实体的帮助类. * * @author Lingo * @since 2007-06-17 */ public final class TreeHelper { /** * protected constructor. */ protected TreeHelper() { } /** * 不允许将自表外键关系设置成环状. * 就是说,当前的current的子节点中,如果包含parent,就不能把parent设置为current的上级节点 *...
package anni.core.domain.tree; /** * 抽象Tree实体. * 提供几个通用的工具方法,并且与javax.persistence无关 * * @author Lingo * @since 2007-06-17 * @param <T> AbstractTreeEntityBean */ public abstract class AbstractTreeEntityBean<T extends AbstractTreeEntityBean<T>> implements TreeEntityBean<T> { /** * @ret...
package anni.core.domain.tree; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.MappedSuperclass; import javax.persistence.OneToMany; im...
package anni.core.domain.tree; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.MappedSuperclass; import javax.persistence.OneToMany; im...
package anni.core.domain.tree; import java.util.Set; import anni.core.domain.NamedEntityBean; /** * 应用于只有id和name两个字段,并自身关联的无级树型字典表. * * 实际中使用时,实现类需要使用导入javax.persistence.Column * 并对name字段进行如下注释 * <pre>@Column(unique = true, nullable = false)</pre> * 我们考虑使用NamedEntityBean的情况,很可能是除了id就只有name字段的情况 ...
package anni.core.domain.tree; import java.text.MessageFormat; import java.util.List; /** * XTree树型辅助生成工具. * * @author Lingo * @since 2007-06-05 */ public class XTreeUtils { /** * 树根结点. */ public static final MessageFormat TREE = new MessageFormat( "var {0}{2}=ne...
package anni.core.domain.tree; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.MappedSuperclass; import javax.persistence.OneToMany; im...
package anni.core.domain.tree; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.MappedSuperclass; import javax.persistence.OneToMany; im...
package anni.core.domain; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.MappedSuperclass; import org.hibernate.annotations.GenericGenerator; /** * 实体类. * 默认实现了id, Serializable接口和equals(), ...
package anni.core.domain; import javax.persistence.Column; import javax.persistence.MappedSuperclass; /** * id是Serializable的Named类实现. * * @author Lingo * @since 2007-06-05 */ @MappedSuperclass public class SerializableNamedEntityBean extends SerializableEntityBean implements NamedEntityBean { ...