public class HibernateCheckConstraint extends Object
Constructor and Description |
---|
HibernateCheckConstraint() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkConstraintsExists(com.atlassian.config.db.HibernateConfig hibernateConfig,
org.hibernate.SessionFactory sessionFactory,
Map<String,io.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 boolean |
constraintsExists(com.atlassian.config.db.HibernateConfig hibernateConfig,
org.hibernate.SessionFactory sessionFactory,
Map<String,com.atlassian.fugue.Pair<String,List<String>>> expectedConstraints)
Deprecated.
since 7.0.1. Use
checkConstraintsExists(HibernateConfig, SessionFactory, Map) |
static Predicate<String> |
createConstraintPredicate(com.atlassian.config.db.HibernateConfig hibernateConfig,
org.hibernate.SessionFactory sessionFactory)
Deprecated.
since 7.13.17
|
static Predicate<String> |
createConstraintPredicate(HibernateDatabaseCapabilities databaseCapabilities,
org.hibernate.SessionFactory sessionFactory) |
static Map<String,List<String>> |
getConstraintsForTable(com.atlassian.config.db.HibernateConfig hibernateConfig,
org.hibernate.SessionFactory sessionFactory,
@NonNull String tableName)
Return a map of unique contraints and it's columns for the given table.
|
@Deprecated public static Predicate<String> createConstraintPredicate(com.atlassian.config.db.HibernateConfig hibernateConfig, org.hibernate.SessionFactory sessionFactory)
public static Predicate<String> createConstraintPredicate(HibernateDatabaseCapabilities databaseCapabilities, 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.@Deprecated public static boolean constraintsExists(com.atlassian.config.db.HibernateConfig hibernateConfig, org.hibernate.SessionFactory sessionFactory, Map<String,com.atlassian.fugue.Pair<String,List<String>>> expectedConstraints)
checkConstraintsExists(HibernateConfig, SessionFactory, Map)
hibernateConfig
- hibernate configsessionFactory
- sessionFactoryexpectedConstraints
- a map of tablename -> pair[constraint name, list[column name for constraint]], of the expected constraints.public static boolean checkConstraintsExists(com.atlassian.config.db.HibernateConfig hibernateConfig, org.hibernate.SessionFactory sessionFactory, Map<String,io.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–2023 Atlassian. All rights reserved.
View cookie preferences