Java 类org.hibernate.type.AbstractSingleColumnStandardBasicType 实例源码
项目:metaworks_framework
文件:GenericEntityDaoImpl.java
@Override
@SuppressWarnings("rawtypes")
public Object readGenericEntity(Class<?> clazz, Object id) {
Map<String, Object> md = daoHelper.getIdMetadata(clazz, (HibernateEntityManager) em);
AbstractSingleColumnStandardBasicType type = (AbstractSingleColumnStandardBasicType) md.get("type");
if (type instanceof LongType) {
id = Long.parseLong(String.valueOf(id));
} else if (type instanceof IntegerType) {
id = Integer.parseInt(String.valueOf(id));
}
return em.find(clazz, id);
}
项目:SparkCommerce
文件:GenericEntityDaoImpl.java
@Override
@SuppressWarnings("rawtypes")
public Object readGenericEntity(Class<?> clazz, Object id) {
Map<String, Object> md = daoHelper.getIdMetadata(clazz, (HibernateEntityManager) em);
AbstractSingleColumnStandardBasicType type = (AbstractSingleColumnStandardBasicType) md.get("type");
if (type instanceof LongType) {
id = Long.parseLong(String.valueOf(id));
} else if (type instanceof IntegerType) {
id = Integer.parseInt(String.valueOf(id));
}
return em.find(clazz, id);
}
项目:blcdemo
文件:GenericEntityDaoImpl.java
@Override
public <T> T readGenericEntity(Class<T> clazz, Object id) {
clazz = (Class<T>) DynamicDaoHelperImpl.getNonProxyImplementationClassIfNecessary(clazz);
Map<String, Object> md = daoHelper.getIdMetadata(clazz, (HibernateEntityManager) em);
AbstractSingleColumnStandardBasicType type = (AbstractSingleColumnStandardBasicType) md.get("type");
if (type instanceof LongType) {
id = Long.parseLong(String.valueOf(id));
} else if (type instanceof IntegerType) {
id = Integer.parseInt(String.valueOf(id));
}
return em.find(clazz, id);
}
项目:jadira
文件:AbstractHeuristicUserType.java
public void setParameterValues(Properties parameters) {
@SuppressWarnings("unchecked")
final AbstractSingleColumnStandardBasicType<? extends Object> heuristicType = (AbstractSingleColumnStandardBasicType<? extends Object>) new TypeResolver().heuristicType(identifierType.getName(), parameters);
if (heuristicType == null) {
throw new HibernateException("Unsupported identifier type " + identifierType.getName());
}
type = heuristicType;
sqlTypes = new int[]{ type.sqlType() };
}
项目:jadira
文件:AbstractHeuristicUserType.java
protected AbstractSingleColumnStandardBasicType<?> getType() {
return type;
}