com.liferay.change.tracking.internal.reference.TableUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.change.tracking.service
Show all versions of com.liferay.change.tracking.service
Liferay Change Tracking Service
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
package com.liferay.change.tracking.internal.reference;
import com.liferay.petra.sql.dsl.Column;
import com.liferay.petra.sql.dsl.Table;
import java.util.Objects;
/**
* @author Preston Crary
*/
public class TableUtil {
@SuppressWarnings("unchecked")
public static > Column getPrimaryKeyColumn(
Table table) {
for (Column column : table.getColumns()) {
if (column.isPrimaryKey() &&
!Objects.equals(column.getName(), "ctCollectionId") &&
Long.class.isAssignableFrom(column.getJavaType())) {
return (Column)column;
}
}
return null;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy