首页 > 解决方案 > 将 liferay 5.2.3 升级到 6.0.6 时出错 密钥“PRIMARY”的重复条目“”

问题描述

我正在尝试将 liferay 5.2.3 升级到 6.0.6,并且此代码发生了 tagsAsset 表中的异常主键等于assetEntry 表中的主键,并且此代码希望从 tagsAsset 中选择并插入发生异常的assetEntry:

con = DataAccess.getConnection();

        ps = con.prepareStatement("select * from TagsAsset");

        rs = ps.executeQuery();

        while (rs.next()) {
            long assetId = rs.getLong("assetId");
            long groupId = rs.getLong("groupId");
            long companyId = rs.getLong("companyId");
            long userId = rs.getLong("userId");
            String userName = rs.getString("userName");
            Timestamp createDate = rs.getTimestamp("createDate");
            Timestamp modifiedDate = rs.getTimestamp("modifiedDate");
            long classNameId = rs.getLong("classNameId");
            long classPK = rs.getLong("classPK");
            boolean visible = rs.getBoolean("visible");
            Timestamp startDate = rs.getTimestamp("startDate");
            Timestamp endDate = rs.getTimestamp("endDate");
            Timestamp publishDate = rs.getTimestamp("publishDate");
            Timestamp expirationDate = rs.getTimestamp("expirationDate");
            String mimeType = rs.getString("mimeType");
            String title = rs.getString("title");
            String description = rs.getString("description");
            String summary = rs.getString("summary");
            String url = rs.getString("url");
            int height = rs.getInt("height");
            int width = rs.getInt("width");
            double priority = rs.getDouble("priority");
            int viewCount = rs.getInt("viewCount");

            addEntry(
                assetId, groupId, companyId, userId, userName, createDate,
                modifiedDate, classNameId, classPK, visible, startDate,
                endDate, publishDate, expirationDate, mimeType, title,
                description, summary, url, height, width, priority,
                viewCount);

标签: liferayupgrade

解决方案


推荐阅读