public void update(String statementName, Object parameter, int requiredRowsAffected) { goCache.stopServingForTransaction(); int actualRowsAffected = delegate.update(statementName, parameter); if (actualRowsAffected != requiredRowsAffected) { throw new JdbcUpdateAffectedIncorrectNumberOfRowsException( statementName, requiredRowsAffected, actualRowsAffected); } }
public int update(String statementName, Object parameter) { goCache.stopServingForTransaction(); return delegate.update(translateStatementName(statementName), parameter); }
@Override protected int updateContentDataEntity(ContentDataEntity entity) { entity.incrementVersion(); return template.update(UPDATE_CONTENT_DATA, entity); }
@Override protected int updateAclEntity(AclEntity updatedAclEntity) { updatedAclEntity.incrementVersion(); return template.update(UPDATE_ACL, updatedAclEntity); }
@Override protected int deleteQNameEntity(QNameEntity entity) { return template.update(DELETE_QNAME, entity.getId()); } }
@Override protected int updateNode(NodeUpdateEntity nodeUpdate) { // Increment the version nodeUpdate.incrementVersion(); return template.update(UPDATE_NODE, nodeUpdate); }
@Override protected int updateAclEntity(AclEntity updatedAclEntity) { updatedAclEntity.incrementVersion(); return template.update(UPDATE_ACL, updatedAclEntity); }
@Override protected int deleteQNameEntity(QNameEntity entity) { return template.update(DELETE_QNAME, entity.getId()); } }
@Override public int updatePersonSizeCurrentType() { Map<String, Object> params = new HashMap<String, Object>(2); Long sizeCurrentPropQNameId = qnameDAO.getOrCreateQName(ContentModel.PROP_SIZE_CURRENT).getFirst(); params.put("sizeCurrentQNameId", sizeCurrentPropQNameId); return template.update(UPDATE_PERSON_SIZECURRENT_TYPE, params); }
@Override protected PropertyUniqueContextEntity updatePropertyUniqueContext(PropertyUniqueContextEntity entity) { entity.incrementVersion(); int updated = template.update(UPDATE_PROPERTY_UNIQUE_CTX, entity); if (updated != 1) { // unexpected number of rows affected throw new ConcurrencyFailureException("Incorrect number of rows affected for updatePropertyUniqueContext: " + entity + ": expected 1, actual " + updated); } return entity; }
@Override protected PropertyRootEntity updatePropertyRoot(PropertyRootEntity entity) { entity.incrementVersion(); int updated = template.update(UPDATE_PROPERTY_ROOT, entity); if (updated != 1) { // unexpected number of rows affected throw new ConcurrencyFailureException("Incorrect number of rows affected for updatePropertyRoot: " + entity + ": expected 1, actual " + updated); } return entity; }
@Override protected int updateNamespaceEntity(NamespaceEntity entity, String uri) { entity.setUriSafe(uri); entity.incrementVersion(); return template.update(UPDATE_NS, entity); }
@Override protected int updateNodes(Long txnId, List<Long> nodeIds) { if (nodeIds.size() == 0) { return 0; } IdsEntity ids = new IdsEntity(); ids.setIdOne(txnId); ids.setIds(nodeIds); return template.update(UPDATE_NODE_BULK_TOUCH, ids); }
@Override protected int updateNodeAssoc(Long id, int assocIndex) { NodeAssocEntity assoc = new NodeAssocEntity(); assoc.setId(id); assoc.setAssocIndex(assocIndex); return template.update(UPDATE_NODE_ASSOC, assoc); }
@Override protected int updateChangeSetEntity(Long id, long commitTimeMs) { AclChangeSetEntity entity = new AclChangeSetEntity(); entity.setId(id); entity.setCommitTimeMs(commitTimeMs); return template.update(UPDATE_ACL_CHANGESET, entity); }
@Override protected int updateQNameEntity(QNameEntity entity, Long nsId, String localName) { entity.setNamespaceId(nsId); entity.setLocalNameSafe(localName); entity.incrementVersion(); return template.update(UPDATE_QNAME, entity); }
@Override protected int updateQNameEntity(QNameEntity entity, Long nsId, String localName) { entity.setNamespaceId(nsId); entity.setLocalNameSafe(localName); entity.incrementVersion(); return template.update(UPDATE_QNAME, entity); }
public int updatePostStatus(long id, ActivityPostEntity.STATUS status) throws SQLException { ActivityPostEntity post = new ActivityPostEntity(); post.setId(id); post.setStatus(status.toString()); post.setLastModified(new Date()); return template.update("alfresco.activities.update_activity_post_status", post); }
public void rw() { Students students = (Students)sqlSessionTemplate.selectOne("selectByPrimaryKey", 1L); System.out.println(students.getName()); students.setName("rw"); sqlSessionTemplate.update("updateByPrimaryKeySelective", students); studentsMapper.updateByPrimaryKeySelective(students); students.setId(2L); studentsMapper.updateByPrimaryKeySelective(students); students = studentsMapper.selectByPrimaryKey(2L); System.out.println(students.getName()); // throw new RuntimeException(); }
@Override protected int updateAclMemberEntity(AclMemberEntity updatedAclMemberEntity) { AclMemberEntity existingAclMemberEntity = getAclMemberEntity(updatedAclMemberEntity.getAclId(), updatedAclMemberEntity.getAceId(), updatedAclMemberEntity.getPos()); if(existingAclMemberEntity != null) { deleteAclMemberEntities(Collections.singletonList(existingAclMemberEntity.getId())); } updatedAclMemberEntity.incrementVersion(); return template.update(UPDATE_ACL_MEMBER, updatedAclMemberEntity); }