
com.liferay.mobile.device.rules.convert.database.MDRDatabaseConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.mobile.device.rules.service Show documentation
Show all versions of com.liferay.mobile.device.rules.service Show documentation
Liferay Mobile Device Rules Service
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.mobile.device.rules.convert.database;
import com.liferay.portal.convert.database.DatabaseConverter;
import com.liferay.portal.convert.util.HibernateModelUtil;
import com.liferay.portal.convert.util.ModelMigrator;
import javax.sql.DataSource;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
/**
* @author Cristina González
*/
@Component(immediate = true, service = DatabaseConverter.class)
public class MDRDatabaseConverter implements DatabaseConverter {
@Override
public void convert(DataSource dataSource) throws Exception {
Class> clazz = getClass();
_modelMigrator.migrate(
dataSource,
HibernateModelUtil.getModelClassNames(
clazz.getClassLoader(), ".*MDR.*"));
}
@Reference(unbind = "-")
private void setModelMigrator(ModelMigrator modelMigrator) {
_modelMigrator = modelMigrator;
}
private ModelMigrator _modelMigrator;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy