Package com.storedobject.core
Class StoredObjectUtility
java.lang.Object
com.storedobject.core.StoredObjectUtility
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStoredObjectUtility.Link<L extends StoredObject>static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringListbrowseColumns(Class<? extends StoredObject> objectClass) static StringbrowseOrder(Class<? extends StoredObject> objectClass) static <T extends StoredObject>
booleanchanged(T newObject, T oldObject, StyledBuilder changes) static ClassAttribute<? extends StoredObject> classAttribute(int family) static <T extends StoredObject>
ClassAttribute<T> classAttribute(Class<T> objectClass) static <T extends StoredObject>
ClassAttribute<T> classAttribute(T object) static String[]createDDL(Class<? extends StoredObject> objectClass) static StoredObjectUtility.Link<?> createLink(Class<? extends StoredObject> masterClass, String linkDetails) Creates a new Link object based on the specified master class and link details.static MethodcreateMethod(Class<?> objectClass, String attributeName) createMethodList(Class<?> objectClass, String attributeName) static StoredObjectUtility.MethodList[]createMethodLists(Class<?> objectClass, StringList attributeNames) static Method[]createMethods(Class<?> objectClass, String[] attributeNames) static StringcreateSQL(ClassAttribute<?> ca, String columns, String condition, String order, boolean only, boolean header, int skip, int limit, int[] distinct) Create a SQL execution string.static StringListdisplayColumns(Class<? extends StoredObject> objectClass) static String[]dropDDL(Class<? extends StoredObject> objectClass) static <O extends StoredObject>
StringBuilderdump(StoredObject object, StringBuilder buffer) static ObjectemptyValue(Class<?> p) static booleanstatic voidexecuteRaw(Method method, Object object, Object objectValue) static <T extends StoredObject>
intstatic String[]foreignKeysDDL(Class<? extends StoredObject> objectClass) static <T extends StoredObject>
Tstatic <T extends StoredObject>
Tstatic <T extends StoredObject>
Tstatic <T extends StoredObject>
Tstatic Class<? extends StoredObject> getObjectClass(String className) static QuerygetTransactionLog(SystemUser su, Timestamp from, Timestamp to) static inthints(Class<? extends StoredObject> objectClass) static inthowBig(Class<? extends StoredObject> objectClass, boolean any) static Propertiesinitialize(File properties) static Propertiesinitialize(File properties, Properties variables) static Propertiesstatic Propertiesinitialize(InputStream in, Properties variables) static Propertiesinitialize(String propertiesFileName) static Propertiesinitialize(String propertiesFileName, Properties variables) static Propertiesinitialize(Properties properties) static Propertiesinitialize(Properties properties, Properties variables) static ArrayList<StoredObjectUtility.Link<?>> linkDetails(Class<? extends StoredObject> masterClass) static ArrayList<StoredObjectUtility.Link<?>> linkDetails(Class<? extends StoredObject> masterClass, StringList extraLinks) static StringListlinks(Class<? extends StoredObject> masterClass) static <T extends StoredObject>
ObjectIterator<T> static <T extends StoredObject>
ObjectIterator<T> static <T extends StoredObject>
ObjectIterator<T> static <T extends StoredObject>
ObjectIterator<T> static StringListprotectedColumns(Class<? extends StoredObject> objectClass) static String[]reindex(Class<? extends StoredObject> objectClass) static <O extends StoredObject>
OretrieveObject(Class<O> objectClass, Object value) Retrieve an instance of theStoredObjectfrom the value provided.static booleansameContent(TransactionManager tm, StoredObject one, StoredObject two) static StringListsearchColumns(Class<? extends StoredObject> objectClass) static Stringstatic StringstackTrace(int count) static StringstackTrace(int count, boolean includeCore) static StringstackTrace(int count, boolean includeCore, int skip) static intstatusUI(Class<? extends StoredObject> objectClass) static voidsubstituteVariables(Properties properties, Properties variables) static Stringstatic Stringstatic <O extends StoredObject>
StringtoString(StoredObject object) static <O extends StoredObject>
StringtoString(StoredObject object, boolean showAttributes)
-
Constructor Details
-
StoredObjectUtility
public StoredObjectUtility()
-
-
Method Details
-
classAttribute
-
family
-
classAttribute
-
classAttribute
-
createDDL
- Throws:
Exception
-
foreignKeysDDL
-
dropDDL
-
reindex
-
substituteVariables
-
initialize
-
initialize
-
initialize
-
initialize
-
initialize
-
initialize
-
initialize
-
initialize
-
howBig
-
hints
-
statusUI
-
displayColumns
-
searchColumns
-
protectedColumns
-
browseColumns
-
links
-
browseOrder
-
toDisplay
-
toDisplay
-
createMethod
-
createMethods
-
createMethodList
public static StoredObjectUtility.MethodList createMethodList(Class<?> objectClass, String attributeName) -
createMethodLists
public static StoredObjectUtility.MethodList[] createMethodLists(Class<?> objectClass, StringList attributeNames) -
execute
-
executeRaw
-
emptyValue
-
retrieveObject
Retrieve an instance of theStoredObjectfrom the value provided. The value may be anything including some representation of theIdor the object's stringified value from which it can be crated using its "get" method if it exists.- Type Parameters:
O- Type of theStoredObject.- Parameters:
objectClass- Class of theStoredObject.value- Value to be converted.- Returns:
- The instance created or null if not convertible.
-
toString
-
toString
-
dump
public static <O extends StoredObject> StringBuilder dump(StoredObject object, StringBuilder buffer) -
getObjectClass
-
createLink
public static StoredObjectUtility.Link<?> createLink(Class<? extends StoredObject> masterClass, String linkDetails) Creates a new Link object based on the specified master class and link details.Format of the link details: Name|Class name[/Any[/Link type]]|Order by|Columns Name|Class name[/Link type[/Any]]Order by|Columns- Parameters:
masterClass- the class of the master object with which the link is associated; must be a subclass of StoredObjectlinkDetails- a string defining the link details; the format of this string determines various properties of the created link- Returns:
- a newly created Link object configured according to the given master class and link details
- Throws:
SOClassError- if the link details are invalid for the specified master class
-
linkDetails
public static ArrayList<StoredObjectUtility.Link<?>> linkDetails(Class<? extends StoredObject> masterClass) -
linkDetails
public static ArrayList<StoredObjectUtility.Link<?>> linkDetails(Class<? extends StoredObject> masterClass, StringList extraLinks) -
get
public static <T extends StoredObject> T get(Class<T> objectClass, String nameField, String nameValue) -
get
public static <T extends StoredObject> T get(Class<T> objectClass, String nameField, String nameValue, String extraCondition) -
list
public static <T extends StoredObject> ObjectIterator<T> list(Class<T> objectClass, String nameField, String nameValue) -
list
public static <T extends StoredObject> ObjectIterator<T> list(Class<T> objectClass, String nameField, String nameValue, String extraCondition) -
get
public static <T extends StoredObject> T get(Class<T> objectClass, String nameField, String nameValue, boolean any) -
get
public static <T extends StoredObject> T get(Class<T> objectClass, String nameField, String nameValue, String extraCondition, boolean any) -
list
public static <T extends StoredObject> ObjectIterator<T> list(Class<T> objectClass, String nameField, String nameValue, boolean any) -
list
public static <T extends StoredObject> ObjectIterator<T> list(Class<T> objectClass, String nameField, String nameValue, String extraCondition, boolean any) -
stackTrace
-
stackTrace
-
stackTrace
-
stackTrace
-
getTransactionLog
-
sameContent
public static boolean sameContent(TransactionManager tm, StoredObject one, StoredObject two) throws Exception - Throws:
Exception
-
changed
public static <T extends StoredObject> boolean changed(T newObject, T oldObject, StyledBuilder changes) -
createSQL
public static String createSQL(ClassAttribute<?> ca, String columns, String condition, String order, boolean only, boolean header, int skip, int limit, int[] distinct) Create a SQL execution string. (Can be used for debugging purposes).- Parameters:
ca- Class attribute.columns- Columns.condition- Condition.order- Order by clause.only- Whether to use inherited instances or not.header- Header to be used or not.skip- Number of rows to be skipped before returning the results.limit- Limit the number of rows.distinct- Column numbers for the DISTINCT clause. An empty array is used to consider all the columns.- Returns:
- SQL string.
-