Class Utilities
- java.lang.Object
-
- com.github.collinalpert.java2db.utilities.Utilities
-
public class Utilities extends java.lang.Object- Author:
- Collin Alpert
-
-
Constructor Summary
Constructors Constructor Description Utilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends BaseEntity>
java.util.ArrayList<java.lang.reflect.Field>getAllFields(T instance)static <T extends BaseEntity>
java.util.ArrayList<java.lang.reflect.Field>getAllFields(T instance, boolean includeForeignKeys)static <T extends BaseEntity>
java.util.ArrayList<java.lang.reflect.Field>getAllFields(T instance, java.lang.Class<?> delimiter)static <T extends BaseEntity>
java.util.ArrayList<java.lang.reflect.Field>getAllFields(T instance, java.lang.Class<?> delimiter, boolean includeForeignKeys)Gets all fields of an entity including all base classes.static voidlog(java.lang.Object text)Prints messages to the query, while considering theLOG_QUERIESconstant.static voidlogf(java.lang.String text, java.lang.Object... params)Prints formatted messages to the query, while considering theLOG_QUERIESconstant.
-
-
-
Method Detail
-
getAllFields
public static <T extends BaseEntity> java.util.ArrayList<java.lang.reflect.Field> getAllFields(T instance)
-
getAllFields
public static <T extends BaseEntity> java.util.ArrayList<java.lang.reflect.Field> getAllFields(T instance, boolean includeForeignKeys)
-
getAllFields
public static <T extends BaseEntity> java.util.ArrayList<java.lang.reflect.Field> getAllFields(T instance, java.lang.Class<?> delimiter)
-
getAllFields
public static <T extends BaseEntity> java.util.ArrayList<java.lang.reflect.Field> getAllFields(T instance, java.lang.Class<?> delimiter, boolean includeForeignKeys)
Gets all fields of an entity including all base classes.- Type Parameters:
T- The type of the entity.- Parameters:
instance- The instance to get the fields of.delimiter- Up to which parent class to go to.includeForeignKeys- Decides if to include foreign key objects in this list, since they do not exist on the database.- Returns:
- A list with all fields of this class and its parents, up to the delimiter class.
-
log
public static void log(java.lang.Object text)
Prints messages to the query, while considering theLOG_QUERIESconstant.- Parameters:
text- The message to print.
-
logf
public static void logf(java.lang.String text, java.lang.Object... params)Prints formatted messages to the query, while considering theLOG_QUERIESconstant.- Parameters:
text- The formatted text.params- The parameters to be inserted into the string.
-
-