public class HibernateCheckConstraint extends Object
Constructor and Description |
---|
HibernateCheckConstraint() |
Modifier and Type | Method and Description |
---|---|
static boolean |
constraintsExists(com.atlassian.config.db.HibernateConfig hibernateConfig,
org.hibernate.SessionFactory sessionFactory,
Map<String,com.atlassian.fugue.Pair<String,List<String>>> expectedConstraints)
Take an expected map of [tablename, pair[constraint name, list[column name for constraint]]], and work out if the given constraints for the given table
exists in the database.
|
static Predicate<String> |
createConstraintPredicate(com.atlassian.config.db.HibernateConfig hibernateConfig,
org.hibernate.SessionFactory sessionFactory) |
static Map<String,List<String>> |
getConstraintsForTable(com.atlassian.config.db.HibernateConfig hibernateConfig,
org.hibernate.SessionFactory sessionFactory,
String tableName)
Return a map of unique contraints and it's columns for the given table.
|
public static Predicate<String> createConstraintPredicate(com.atlassian.config.db.HibernateConfig hibernateConfig, org.hibernate.SessionFactory sessionFactory)
public static Map<String,List<String>> getConstraintsForTable(com.atlassian.config.db.HibernateConfig hibernateConfig, org.hibernate.SessionFactory sessionFactory, @Nonnull String tableName)
tableName
- a table name.public static boolean constraintsExists(com.atlassian.config.db.HibernateConfig hibernateConfig, org.hibernate.SessionFactory sessionFactory, Map<String,com.atlassian.fugue.Pair<String,List<String>>> expectedConstraints)
hibernateConfig
- hibernate configsessionFactory
- sessionFactoryexpectedConstraints
- a map of tablename -> pair[constraint name, list[column name for constraint]], of the expected constraints.Copyright © 2003–2017 Atlassian. All rights reserved.