Package org.sqlproc.engine.impl
Class SqlUtils
- java.lang.Object
-
- org.sqlproc.engine.impl.SqlUtils
-
public class SqlUtils extends Object
SQL Processor utilities.- Author:
- Vladimir Hudec
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static PatternpatternInsert(package private) static StringSQL
-
Constructor Summary
Constructors Constructor Description SqlUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringafterChar(String s, char c)static List<Integer>asList(int[] array)static StringbeforeChar(String s, char c)static ObjectconvertBigDecimal(Class<?> attributeType, Object resultValue)static ObjectconvertBigInteger(Class<?> attributeType, Object resultValue)static StringfirstLowerCase(String s)static Class<?>[]getAllAttributeTypes(Class<?> attributeType, Class<?>[] attributeParameterizedTypes, Class<?> attributeParameterizedType)static DategetDate(int year, int month, int day)static DategetDateTime(int year, int month, int day, int hour, int minute, int second)static StringgetIdsKey(Object[] resultValues, Integer mainIdentityIndex)static StringgetIdsKey(Object[] resultValues, Map<String,SqlMappingIdentity> identities, String fullName)static Object[]getResultValues(Map<String,Object> resultRow)static Class<?>getStandardModeResultClass(String typeName)A temporary gtype to class name conversion.static TimegetTime(int hour, int minute, int second)static StringhandleInsertSql(Map<String,SqlInputValue> identities, String sql)static booleanisCollection(Class<?> clazz)Returns the indicator the investigated class is in fact a container.static booleanisEmpty(StringBuilder sb)static booleanisPrimitiveWrapper(Class clazz)static voidmain(String[] args)static Set<String>oppositeFeatures(String featureName)static Byte[]toBytes(byte[] barr)static byte[]toBytes(Byte[] barr)
-
-
-
Field Detail
-
SQL
static final String SQL
- See Also:
- Constant Field Values
-
patternInsert
static final Pattern patternInsert
-
-
Method Detail
-
convertBigDecimal
public static Object convertBigDecimal(Class<?> attributeType, Object resultValue)
-
convertBigInteger
public static Object convertBigInteger(Class<?> attributeType, Object resultValue)
-
toBytes
public static Byte[] toBytes(byte[] barr)
-
toBytes
public static byte[] toBytes(Byte[] barr)
-
isEmpty
public static boolean isEmpty(StringBuilder sb)
-
getDate
public static Date getDate(int year, int month, int day)
-
getTime
public static Time getTime(int hour, int minute, int second)
-
getDateTime
public static Date getDateTime(int year, int month, int day, int hour, int minute, int second)
-
getIdsKey
public static String getIdsKey(Object[] resultValues, Map<String,SqlMappingIdentity> identities, String fullName)
-
main
public static void main(String[] args)
-
handleInsertSql
public static String handleInsertSql(Map<String,SqlInputValue> identities, String sql)
-
isPrimitiveWrapper
public static boolean isPrimitiveWrapper(Class clazz)
-
isCollection
public static boolean isCollection(Class<?> clazz)
Returns the indicator the investigated class is in fact a container.- Parameters:
clazz- the investigated class- Returns:
- the indicator the investigated class is in fact a container
-
getAllAttributeTypes
public static Class<?>[] getAllAttributeTypes(Class<?> attributeType, Class<?>[] attributeParameterizedTypes, Class<?> attributeParameterizedType)
-
getStandardModeResultClass
public static Class<?> getStandardModeResultClass(String typeName)
A temporary gtype to class name conversion.- Parameters:
typeName- it's a gtype- Returns:
- a related class name
-
-