Here are the examples of the java api com.tle.core.hibernate.impl.HibernateMigrationHelper taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
320 Examples
19
Source : CreateTaskHistoryTable.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getDropModifySql(HibernateMigrationHelper helper) {
return Collections.emptyList();
}
19
Source : MigrateOldTaxonomyToNew.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, "FROM TaxonomyNode") + count(session, "FROM ItemdefBlobs");
}
19
Source : ConstraintToAvoidDuplicateNotificationsMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getDropModifySql(HibernateMigrationHelper helper) {
// false - we specify that we DON'T want to create the foreign key
// constraint(s). In this case, a foreign key for Insreplacedution already
// exists, and Oracle will object to any attempt to make a superfluous
// extra constraint (although Postgres for example will happily allow
// such)
return helper.getAddIndexesAndConstraintsForColumns("notification", false, "insreplacedution_id", "itemid", "reason", "user_to");
}
19
Source : AbstractHibernateSchemaMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
protected boolean migrationIsRequired(HibernateMigrationHelper helper) {
return true;
}
19
Source : AbstractCreateMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
protected void addExtraStatements(HibernateMigrationHelper helper, List<String> statements) {
// nothing
}
18
Source : AddAdvancedFieldsColumnMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getDropModifySql(HibernateMigrationHelper helper) {
return null;
}
18
Source : RemoveViewPackageContentMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, QUERY_WITH_VIEW_CONTENT);
}
18
Source : HtmlFiveMimeTypeAndPlayerMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, "From Insreplacedution");
}
18
Source : SavedSearchToFavouriteSearchMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getDropModifySql(HibernateMigrationHelper helper) {
return Collections.singletonList(// $NON-NLS-1$
"DELETE FROM user_preference WHERE preferenceid = 'saved.searches'");
}
18
Source : SavedSearchToFavouriteSearchMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, // $NON-NLS-1$
"FROM UserPreference WHERE key.preferenceID = 'saved.searches'");
}
18
Source : SavedSearchToFavouriteSearchMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getAddSql(HibernateMigrationHelper helper) {
// $NON-NLS-1$
return helper.getCreationSql(new TablesOnlyFilter("favourite_search"));
}
18
Source : UpdateOlderYoutubeAttachmentMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
/**
* @see
* com.tle.core.migration.AbstractHibernateDataMigration#countDataMigrations(com.tle.core.hibernate.impl.HibernateMigrationHelper,
* org.hibernate.clreplacedic.Session)
*/
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
// Burdensome to evaluate
return 1;
}
18
Source : CreateTomcatSessionEntity.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected HibernateCreationFilter getFilter(HibernateMigrationHelper helper) {
return new TablesOnlyFilter("tomcat_sessions");
}
18
Source : CreateThumbnailRequestSchema.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected HibernateCreationFilter getFilter(HibernateMigrationHelper helper) {
return new TablesOnlyFilter("thumbnail_request");
}
18
Source : WorkflowMessageUuidMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, "FROM WorkflowMessage");
}
18
Source : WorkflowMessageUuidMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getAddSql(HibernateMigrationHelper helper) {
List<String> sql = new ArrayList<String>();
sql.addAll(helper.getAddColumnsSQL(TABLE, COLUMN));
return sql;
}
18
Source : WorkflowMessageUuidMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getDropModifySql(HibernateMigrationHelper helper) {
List<String> dropModify = new ArrayList<String>();
dropModify.addAll(helper.getAddNotNullSQL(TABLE, COLUMN));
dropModify.addAll(helper.getAddIndexesAndConstraintsForColumns(TABLE, COLUMN));
return dropModify;
}
18
Source : CreateTaskHistoryTable.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getAddSql(HibernateMigrationHelper helper) {
return helper.getCreationSql(new TablesOnlyFilter("task_history"));
}
18
Source : CreateTaskHistoryTable.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, "FROM WorkflowNodeStatus");
}
18
Source : AddTaskStartDate.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, QUERY);
}
18
Source : AddTaskStartDate.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getAddSql(HibernateMigrationHelper helper) {
return helper.getAddColumnsSQL("workflow_node_status", "started");
}
18
Source : AddLastActionDate.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getAddSql(HibernateMigrationHelper helper) {
return helper.getAddColumnsSQL("moderation_status", "last_action");
}
18
Source : ReplaceDeletedControlsDatabaseMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, "FROM ItemDefinition");
}
18
Source : CreateUserScriptsSchema.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected HibernateCreationFilter getFilter(HibernateMigrationHelper helper) {
return new TablesOnlyFilter("user_script");
}
18
Source : MigrateOldTaxonomyToNew.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getDropModifySql(HibernateMigrationHelper helper) {
return helper.getDropTableSql("taxonomy_node_all_parents", "taxonomy_node");
}
18
Source : TermUuidMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, "FROM Term");
}
18
Source : IncreaseTermFullPathSizeMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getAddSql(HibernateMigrationHelper helper) {
return null;
}
18
Source : IncreaseTermSize1024Migration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getAddSql(HibernateMigrationHelper helper) {
// We need to drop the old (taxonomy ID + parent ID + value) constraint,
// so create temp column to move the value to, copy the contents, drop
// the column, rename the temp one back to the original.
return helper.getAddColumnsSQL("term", "value_temp", "value_hash");
}
18
Source : IncreaseTermSize1024Migration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, "from Term");
}
18
Source : SecurityMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
int lti = count(session, "FROM LtiConsumer");
int oauth = count(session, "FROM OAuthClient");
int ldapsmtp = count(session.createQuery("SELECT COUNT(*) FROM ConfigurationProperty WHERE property = :smtp OR property = :ldap").setString("smtp", SMTP_PWD_KEY).setString("ldap", LDAP_PWD_KEY));
return lti + oauth + ldapsmtp;
}
18
Source : CreateCachedValueEntity.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected HibernateCreationFilter getFilter(HibernateMigrationHelper helper) {
return new TablesOnlyFilter("cached_value");
}
18
Source : CreateQtiTestSchema.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected HibernateCreationFilter getFilter(HibernateMigrationHelper helper) {
return new TablesOnlyFilter(new String[] { "qti_replacedessment_test", "qti_replacedessment_item", "qti_replacedessment_item_ref" });
}
18
Source : CreateQtiResultSchema.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected HibernateCreationFilter getFilter(HibernateMigrationHelper helper) {
return new TablesOnlyFilter(new String[] { "qti_abstract_result", "qti_replacedessment_result", "qti_item_result", "qti_item_variable", "qti_item_variable_value" });
}
18
Source : PortletAclDatabaseMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
// $NON-NLS-1$
return count(session, "FROM Insreplacedution");
}
18
Source : AddForeignIndexesOAuth.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getAddSql(HibernateMigrationHelper helper) {
List<String> sql = Lists.newArrayList();
sql.addAll(helper.getAddIndexesRaw("oauth_client_permissions", "oac_permissions", "oauth_client_id"));
sql.addAll(helper.getAddIndexesRaw("oauth_token_permissions", "oat_permissions", "oauth_token_id"));
return sql;
}
18
Source : MigrateNotifications2.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getAddSql(HibernateMigrationHelper helper) {
return helper.getAddColumnsSQL(TABLE, "processed", "batched", "itemid_only");
}
18
Source : MigrateNotifications2.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, "from Notification");
}
18
Source : MigrateNotifications.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getDropModifySql(HibernateMigrationHelper helper) {
return helper.getDropTableSql("item_users_notified");
}
18
Source : MigrateNotifications.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, "from ItemUsersNotified");
}
18
Source : MigrateNotifications.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getAddSql(HibernateMigrationHelper helper) {
return helper.getCreationSql(new TablesOnlyFilter("notification"));
}
18
Source : EnsureDefaultMimeSettingsMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
// it's too expensive to work out
return 1;
}
18
Source : PrettyPhotoToFancyBoxDatabaseMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, FROM) + count(session, FROM_ATTACHMENTS);
}
18
Source : RemovePopupFixViewerDatabaseMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, FROM);
}
18
Source : RemoveNavigationGroupsAndLinks.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return 1 + count(session, "FROM NavigationLink") + count(session, "FROM NavigationGroup");
}
18
Source : RemoveHierarchyColumnsMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getDropModifySql(HibernateMigrationHelper helper) {
return helper.getDropColumnSQL(HIERARCHY_TABLE, // $NON-NLS-1$
"key_resources_section_name_id", "subtopic_column_ordering", // $NON-NLS-1$//$NON-NLS-2$
"show_subtopic_result_count");
}
18
Source : RemoveHierarchyColumnsMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return 3 + count(session, // $NON-NLS-1$
"FROM HierarchyTopic WHERE key_resources_section_name_id IS NOT NULL");
}
18
Source : AddCommentsSectionToItemSummarySections.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected int countDataMigrations(HibernateMigrationHelper helper, Session session) {
return count(session, "FROM ItemdefBlobs");
}
18
Source : CreateLogTable.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected HibernateCreationFilter getFilter(HibernateMigrationHelper helper) {
return new TablesOnlyFilter("audit_log_lms");
}
18
Source : EntityDisabledFieldMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getAddSql(HibernateMigrationHelper helper) {
return helper.getAddColumnsSQL(TABLE_ENreplacedY, COL_DISABLED);
}
18
Source : AttachmentPreviewMigration.java
with Apache License 2.0
from openequella
with Apache License 2.0
from openequella
@Override
protected List<String> getDropModifySql(HibernateMigrationHelper helper) {
return helper.getAddNotNullSQL(TABLE_ATTACHMENT, COL_PREVIEW);
}
See More Examples