Commit 41ffb79b authored by Liang Ding's avatar Liang Ding

🎨 Fix #12794

parent da0a77e2
......@@ -36,7 +36,7 @@ import java.util.List;
* Article repository.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.12, Jan 15, 2019
* @version 1.1.1.13, Jun 6, 2019
* @since 0.3.1
*/
@Repository
......@@ -90,8 +90,8 @@ public class ArticleRepository extends AbstractRepository {
}
@Override
public void update(final String id, final JSONObject article) throws RepositoryException {
super.update(id, article);
public void update(final String id, final JSONObject article, final String... propertyNames) throws RepositoryException {
super.update(id, article, propertyNames);
article.put(Keys.OBJECT_ID, id);
articleCache.putArticle(article);
......
......@@ -89,8 +89,8 @@ public class CommentRepository extends AbstractRepository {
}
@Override
public void update(final String id, final JSONObject comment) throws RepositoryException {
super.update(id, comment);
public void update(final String id, final JSONObject comment, final String... propertyNames) throws RepositoryException {
super.update(id, comment, propertyNames);
comment.put(Keys.OBJECT_ID, id);
commentCache.putComment(comment);
......
......@@ -31,7 +31,7 @@ import java.util.List;
* Option repository.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.1, Sep 30, 2018
* @version 1.1.0.2, Jun 6, 2019
* @since 0.6.0
*/
@Repository
......@@ -82,8 +82,8 @@ public class OptionRepository extends AbstractRepository {
}
@Override
public void update(final String id, final JSONObject option) throws RepositoryException {
super.update(id, option);
public void update(final String id, final JSONObject option, final String... propertyNames) throws RepositoryException {
super.update(id, option, propertyNames);
option.put(Keys.OBJECT_ID, id);
optionCache.putOption(option);
......
......@@ -32,7 +32,7 @@ import java.util.List;
* Page repository.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.8, Jan 15, 2019
* @version 1.0.0.9, Jun 6, 2019
* @since 0.3.1
*/
@Repository
......@@ -76,8 +76,8 @@ public class PageRepository extends AbstractRepository {
}
@Override
public void update(final String id, final JSONObject page) throws RepositoryException {
super.update(id, page);
public void update(final String id, final JSONObject page, final String... propertyNames) throws RepositoryException {
super.update(id, page, propertyNames);
page.put(Keys.OBJECT_ID, id);
pageCache.putPage(page);
......
......@@ -30,7 +30,7 @@ import org.json.JSONObject;
* User repository.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.2, Mar 2, 2019
* @version 1.1.0.3, Jun 6, 2019
* @since 0.3.1
*/
@Repository
......@@ -74,8 +74,8 @@ public class UserRepository extends AbstractRepository {
}
@Override
public void update(final String id, final JSONObject user) throws RepositoryException {
super.update(id, user);
public void update(final String id, final JSONObject user, final String... propertyNames) throws RepositoryException {
super.update(id, user, propertyNames);
user.put(Keys.OBJECT_ID, id);
userCache.putUser(user);
......
......@@ -37,7 +37,7 @@ import org.json.JSONObject;
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://vanessa.b3log.org">Vanessa</a>
* @version 1.1.0.18, Apr 19, 2019
* @version 1.1.0.19, Jun 6, 2019
* @since 0.4.0
*/
@Service
......@@ -254,8 +254,8 @@ public class PageMgmtService {
// Swaps
srcPage.put(Page.PAGE_ORDER, targetPage.getInt(Page.PAGE_ORDER));
targetPage.put(Page.PAGE_ORDER, srcPageOrder);
pageRepository.update(srcPage.getString(Keys.OBJECT_ID), srcPage);
pageRepository.update(targetPage.getString(Keys.OBJECT_ID), targetPage);
pageRepository.update(srcPage.getString(Keys.OBJECT_ID), srcPage, Page.PAGE_ORDER);
pageRepository.update(targetPage.getString(Keys.OBJECT_ID), targetPage, Page.PAGE_ORDER);
transaction.commit();
} catch (final Exception e) {
if (transaction.isActive()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment