public OverrideRepository addTypeMapping(SQLTypeMapping sqltype) { TypeMappingKey key = new TypeMappingKey(sqltype); List<SQLTypeMapping> list = typeMappings.get(key); if(list==null) { list = new ArrayList<SQLTypeMapping>(); typeMappings.put(key, list); } list.add(sqltype); return this; }
private String getPreferredHibernateType(int sqlType, int length, int precision, int scale, boolean nullable) { List<SQLTypeMapping> l = typeMappings.get(new TypeMappingKey(sqlType,length) ); if(l == null) { // if no precise length match found, then try to find matching unknown length matches l = typeMappings.get(new TypeMappingKey(sqlType,SQLTypeMapping.UNKNOWN_LENGTH) ); } return scanForMatch( sqlType, length, precision, scale, nullable, l ); }