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

🎨 Fix #12794

parent da0a77e2
...@@ -36,7 +36,7 @@ import java.util.List; ...@@ -36,7 +36,7 @@ import java.util.List;
* Article repository. * Article repository.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @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 * @since 0.3.1
*/ */
@Repository @Repository
...@@ -90,8 +90,8 @@ public class ArticleRepository extends AbstractRepository { ...@@ -90,8 +90,8 @@ public class ArticleRepository extends AbstractRepository {
} }
@Override @Override
public void update(final String id, final JSONObject article) throws RepositoryException { public void update(final String id, final JSONObject article, final String... propertyNames) throws RepositoryException {
super.update(id, article); super.update(id, article, propertyNames);
article.put(Keys.OBJECT_ID, id); article.put(Keys.OBJECT_ID, id);
articleCache.putArticle(article); articleCache.putArticle(article);
......
...@@ -89,8 +89,8 @@ public class CommentRepository extends AbstractRepository { ...@@ -89,8 +89,8 @@ public class CommentRepository extends AbstractRepository {
} }
@Override @Override
public void update(final String id, final JSONObject comment) throws RepositoryException { public void update(final String id, final JSONObject comment, final String... propertyNames) throws RepositoryException {
super.update(id, comment); super.update(id, comment, propertyNames);
comment.put(Keys.OBJECT_ID, id); comment.put(Keys.OBJECT_ID, id);
commentCache.putComment(comment); commentCache.putComment(comment);
......
...@@ -31,7 +31,7 @@ import java.util.List; ...@@ -31,7 +31,7 @@ import java.util.List;
* Option repository. * Option repository.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @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 * @since 0.6.0
*/ */
@Repository @Repository
...@@ -82,8 +82,8 @@ public class OptionRepository extends AbstractRepository { ...@@ -82,8 +82,8 @@ public class OptionRepository extends AbstractRepository {
} }
@Override @Override
public void update(final String id, final JSONObject option) throws RepositoryException { public void update(final String id, final JSONObject option, final String... propertyNames) throws RepositoryException {
super.update(id, option); super.update(id, option, propertyNames);
option.put(Keys.OBJECT_ID, id); option.put(Keys.OBJECT_ID, id);
optionCache.putOption(option); optionCache.putOption(option);
......
...@@ -32,7 +32,7 @@ import java.util.List; ...@@ -32,7 +32,7 @@ import java.util.List;
* Page repository. * Page repository.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @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 * @since 0.3.1
*/ */
@Repository @Repository
...@@ -76,8 +76,8 @@ public class PageRepository extends AbstractRepository { ...@@ -76,8 +76,8 @@ public class PageRepository extends AbstractRepository {
} }
@Override @Override
public void update(final String id, final JSONObject page) throws RepositoryException { public void update(final String id, final JSONObject page, final String... propertyNames) throws RepositoryException {
super.update(id, page); super.update(id, page, propertyNames);
page.put(Keys.OBJECT_ID, id); page.put(Keys.OBJECT_ID, id);
pageCache.putPage(page); pageCache.putPage(page);
......
...@@ -30,7 +30,7 @@ import org.json.JSONObject; ...@@ -30,7 +30,7 @@ import org.json.JSONObject;
* User repository. * User repository.
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @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 * @since 0.3.1
*/ */
@Repository @Repository
...@@ -74,8 +74,8 @@ public class UserRepository extends AbstractRepository { ...@@ -74,8 +74,8 @@ public class UserRepository extends AbstractRepository {
} }
@Override @Override
public void update(final String id, final JSONObject user) throws RepositoryException { public void update(final String id, final JSONObject user, final String... propertyNames) throws RepositoryException {
super.update(id, user); super.update(id, user, propertyNames);
user.put(Keys.OBJECT_ID, id); user.put(Keys.OBJECT_ID, id);
userCache.putUser(user); userCache.putUser(user);
......
...@@ -37,7 +37,7 @@ import org.json.JSONObject; ...@@ -37,7 +37,7 @@ import org.json.JSONObject;
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://vanessa.b3log.org">Vanessa</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 * @since 0.4.0
*/ */
@Service @Service
...@@ -254,8 +254,8 @@ public class PageMgmtService { ...@@ -254,8 +254,8 @@ public class PageMgmtService {
// Swaps // Swaps
srcPage.put(Page.PAGE_ORDER, targetPage.getInt(Page.PAGE_ORDER)); srcPage.put(Page.PAGE_ORDER, targetPage.getInt(Page.PAGE_ORDER));
targetPage.put(Page.PAGE_ORDER, srcPageOrder); targetPage.put(Page.PAGE_ORDER, srcPageOrder);
pageRepository.update(srcPage.getString(Keys.OBJECT_ID), srcPage); pageRepository.update(srcPage.getString(Keys.OBJECT_ID), srcPage, Page.PAGE_ORDER);
pageRepository.update(targetPage.getString(Keys.OBJECT_ID), targetPage); pageRepository.update(targetPage.getString(Keys.OBJECT_ID), targetPage, Page.PAGE_ORDER);
transaction.commit(); transaction.commit();
} catch (final Exception e) { } catch (final Exception e) {
if (transaction.isActive()) { 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