public class HibernateUtils extends Object
Constructor and Description |
---|
HibernateUtils() |
Modifier and Type | Method and Description |
---|---|
static List<String> |
getHibernateTableColumnNames(org.hibernate.SessionFactory factory,
Class klass,
boolean includeTablePrefix)
Uses hibernate to get all appropriate table column names for the given Hibernate model class.
|
static void |
validateHibernateColumnNames(org.hibernate.SessionFactory factory,
Class klass,
boolean includeTablePrefix,
String... columnNames) |
static void |
validateHibernateColumnNames(org.hibernate.SessionFactory factory,
List<Class> klasses,
boolean includeTablePrefix,
String... columnNames)
Checks that all given column names, if not null, are appropriate table column names for the given
Hibernate model class.
|
public static List<String> getHibernateTableColumnNames(org.hibernate.SessionFactory factory, Class klass, boolean includeTablePrefix)
factory
- The active Hibernate sessionklass
- The Hibernate model objectincludeTablePrefix
- If true, each column name will have the table name added as a prefixpublic static void validateHibernateColumnNames(org.hibernate.SessionFactory factory, List<Class> klasses, boolean includeTablePrefix, String... columnNames)
factory
- Active hibernate session factoryklasses
- Hibernate model object classesincludeTablePrefix
- If true, the given column names include the table name as a prefixcolumnNames
- List of column names to check the validity of.IllegalArgumentException
- If any of the column names are invalid.Copyright © 2022. All rights reserved.