Skip to content

Commit

Permalink
QueryedRecord use
Browse files Browse the repository at this point in the history
  • Loading branch information
getrebuild committed Apr 1, 2024
1 parent e4d0b84 commit 615ca27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>cn.devezhao</groupId>
<artifactId>persist4j</artifactId>
<version>1.7.7</version>
<version>1.7.8</version>
<packaging>jar</packaging>

<name>persist4j</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public PersistManagerFactory getPersistManagerFactory() {
@Override
public Record save(final Record record) throws DataAccessException {
Validate.isTrue(record.getPrimary() == null);
Validate.isTrue(!(record instanceof QueryedRecord), "QueryedRecord cannot be used for save");
if (record instanceof QueryedRecord) LOG.warn("QueryedRecord do not use for save");

Entity e = record.getEntity();
return saveInternal(record, ID.newId(e.getEntityCode()));
Expand Down Expand Up @@ -134,7 +134,7 @@ public Object doInParameters(PreparedStatement pstmt) {
@Override
public Record update(final Record record) throws DataAccessException {
Validate.notNull(record.getPrimary());
Validate.isTrue(!(record instanceof QueryedRecord), "QueryedRecord cannot be used for update");
if (record instanceof QueryedRecord) LOG.warn("QueryedRecord do not use for update");

Entity e = record.getEntity();

Expand Down

0 comments on commit 615ca27

Please sign in to comment.