⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list2types.java

📁 分页类,包括中文和英文及其他语言种类,便于二次开发及商业开发,
💻 JAVA
字号:
package com.laoer.comm.db;

import net.sf.hibernate.type.*;
import net.sf.hibernate.*;
import java.util.*;

/**
 * <p>Title: 天乙软件工作室公共包</p>
 * <p>Description: 天乙软件工作室公共包</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: 天乙软件工作室[LAOER.COM/TIANYISOFT.NET]</p>
 * @author 龚天乙(Laoer)
 * @version 1.0
 */

public class List2Types {

  public static Type[] getTypes(Object[] os) {
    int size = os.length;
    Type[] types = new Type[size];
    for (int i = 0; i < size; i++) {
      if (os[i] instanceof java.lang.String) {
        types[i] = Hibernate.STRING;
        continue;
      }
      if (os[i] instanceof java.lang.Long) {
        types[i] = Hibernate.LONG;
        continue;
      }
      if (os[i] instanceof java.lang.Integer) {
        types[i] = Hibernate.INTEGER;
        continue;
      }

      if (os[i] instanceof java.util.Date) {
        types[i] = Hibernate.DATE;
        continue;
      }
      if (os[i] instanceof java.lang.Short) {
        types[i] = Hibernate.SHORT;
        continue;
      }
      if (os[i] instanceof java.lang.Float) {
        types[i] = Hibernate.FLOAT;
        continue;
      }
      if (os[i] instanceof java.lang.Double) {
        types[i] = Hibernate.DOUBLE;
        continue;
      }
    }
    return types;
  }

  public static Type[] getTypes(List values) {
    Object[] os = values.toArray();
    Type[] types = getTypes(os);
    return types;
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -