Spring Framework MapSqlParameterSource - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework MapSqlParameterSource class.

This code example shows how to use the following methods:addValue
     
    @After 
    public void after() throws DatastoreException { 
        if(dboBasicDao != null) {
        	// delete participant 
            MapSqlParameterSource params = new MapSqlParameterSource();
            params.addValue("userId", userId);
            params.addValue("evalId", evalId);
            dboBasicDao.deleteObjectByPrimaryKey(ParticipantDBO.class, params);
             
            // delete Evaluation 
            params.addValue("id", evalId);
            dboBasicDao.deleteObjectByPrimaryKey(EvaluationDBO.class, params);
        } 
    } 
    @Test
    public void testCRD() throws Exception{
        // Initialize a new Participant 
        ParticipantDBO participant = new ParticipantDBO();
        participant.setUserId(userId);
7
CodeRank
This code example shows how to use the following methods:addValue
    } 
 
    @Override 
    protected MapSqlParameterSource createFullParametersMapper(NetworkQoS networkQos) {
        MapSqlParameterSource map = super.createFullParametersMapper(networkQos);
        map.addValue("inbound_average", networkQos.getInboundAverage());
        map.addValue("inbound_peak", networkQos.getInboundPeak());
        map.addValue("inbound_burst", networkQos.getInboundBurst());
        map.addValue("outbound_average", networkQos.getOutboundAverage());
        map.addValue("outbound_peak", networkQos.getOutboundPeak());
        map.addValue("outbound_burst", networkQos.getOutboundBurst());
        return map;
    } 
 
    @Override 
    protected RowMapper<NetworkQoS> createEntityRowMapper() {
        return NetworkQosDaoDbFacadaeImplMapper.MAPPER;
    } 
 
    public static class NetworkQosDaoDbFacadaeImplMapper extends QosBaseDaoFacadaeImplMapper<NetworkQoS> { 
7
CodeRank
This code example shows how to use the following methods:addValue
		// Create it 
		DBONodeType clone = dboBasicDao.createNew(nodeType);
		assertNotNull(clone);
		assertEquals(nodeType, clone);
		// Fetch it 
		MapSqlParameterSource params = new MapSqlParameterSource();
		params.addValue("id", id);
		params.addValue("name", name);
		clone = dboBasicDao.getObjectByPrimaryKey(DBONodeType.class, params);
		assertNotNull(clone);
		assertEquals(nodeType.getId(), clone.getId());
		assertEquals(nodeType.getName(), clone.getName());
		// Delete it 
		boolean result = dboBasicDao.deleteObjectByPrimaryKey(DBONodeType.class,  params);
		assertTrue("Failed to delete the type created", result);
		 
	} 
	 
	@Test
	public void testAliasCRUD() throws Exception{
6
CodeRank
This code example shows how to use the following methods:addValue
    } 
 
    @Override 
    protected MapSqlParameterSource createFullParametersMapper(StorageQos obj) {
        MapSqlParameterSource map = super.createFullParametersMapper(obj);
        map.addValue("max_throughput", obj.getMaxThroughput());
        map.addValue("max_read_throughput", obj.getMaxReadThroughput());
        map.addValue("max_write_throughput", obj.getMaxWriteThroughput());
        map.addValue("max_iops", obj.getMaxIops());
        map.addValue("max_read_iops", obj.getMaxReadIops());
        map.addValue("max_write_iops", obj.getMaxWriteIops());
 
        return map;
    } 
 
    @Override 
    protected RowMapper<StorageQos> createEntityRowMapper() {
        return StorageDaoDbFacadaeImplMapper.MAPPER;
    } 
 
7
CodeRank
This code example shows how to use the following methods:addValue
		DBOAccessRequirement clone = dboBasicDao.createNew(accessRequirement);
		assertNotNull(clone);
		assertEquals(accessRequirement, clone);
		 
		// Fetch it 
		MapSqlParameterSource params = new MapSqlParameterSource();
		params.addValue("id", accessRequirement.getId());
		clone = dboBasicDao.getObjectByPrimaryKey(DBOAccessRequirement.class, params);
		assertNotNull(clone);
		assertEquals(accessRequirement, clone);
		 
		// Update it 
		dboBasicDao.update(clone);
		clone = dboBasicDao.getObjectByPrimaryKey(DBOAccessRequirement.class, params);
		assertNotNull(clone);
		 
		// Delete it 
		boolean result = dboBasicDao.deleteObjectByPrimaryKey(DBOAccessRequirement.class,  params);
		assertTrue("Failed to delete the type created", result);
		 

6
CodeRank
This code example shows how to use the following methods:addValue
		rev.setModifiedBy(createdById);
		rev.setModifiedOn(System.currentTimeMillis());
		// Now create it 
		rev = dboBasicDao.createNew(rev);
		// Make sure we can get it 
		MapSqlParameterSource params = new MapSqlParameterSource();
		params.addValue("owner", rev.getOwner());
		params.addValue("revisionNumber", rev.getRevisionNumber());
		DBORevision clone = dboBasicDao.getObjectByPrimaryKey(DBORevision.class, params);
		assertEquals(rev, clone);
		// Update with some values 
		clone.setAnnotations("Fake annotations".getBytes("UTF-8"));
		clone.setReferences("Fake References".getBytes("UTF-8"));
		clone.setComment("No comment!");
		boolean result = dboBasicDao.update(clone);
		assertTrue(result);
		// Fetch the updated 
		DBORevision updatedClone = dboBasicDao.getObjectByPrimaryKey(DBORevision.class, params);
		assertEquals(clone, updatedClone);
	} 

6
CodeRank
This code example shows how to use the following methods:addValue
            MapSqlParameterSource params = new MapSqlParameterSource();
            params.addValue("id", submissionId);
            dboBasicDao.deleteObjectByPrimaryKey(SubmissionDBO.class, params);
             
            // delete participant 
            params = new MapSqlParameterSource();
            params.addValue("userId", userId);
            params.addValue("evalId", evalId);
            dboBasicDao.deleteObjectByPrimaryKey(ParticipantDBO.class, params);
             
            // delete Evaluation 
            params = new MapSqlParameterSource();
            params.addValue("id", evalId);
            dboBasicDao.deleteObjectByPrimaryKey(EvaluationDBO.class, params);
        } 
    	try { 
    		nodeDAO.delete(nodeId);
    	} catch (NotFoundException e) {};
    } 
    @Test
6
CodeRank
This code example shows how to use the following methods:addValue
		// Create it 
		DBOUserProfile clone = dboBasicDao.createNew(userProfile);
		assertNotNull(clone);
		assertEquals(userProfile, clone);
		// Fetch it 
		MapSqlParameterSource params = new MapSqlParameterSource();
		params.addValue("ownerId", individualGroup.getId());
		clone = dboBasicDao.getObjectByPrimaryKey(DBOUserProfile.class, params);
		assertNotNull(clone);
		assertEquals(userProfile.getOwnerId(), clone.getOwnerId());
		 
		// Update it 
		String newContent = "Your dog has fleas!";
		clone.setProperties(newContent.getBytes());
		dboBasicDao.update(clone);
		clone = dboBasicDao.getObjectByPrimaryKey(DBOUserProfile.class, params);
		assertNotNull(clone);
		assertEquals(newContent, new String(clone.getProperties()));
		 
		// Delete it 

6
CodeRank
This code example shows how to use the following methods:addValue
        SubmissionDBO clone = dboBasicDao.createNew(submission);
        assertNotNull(clone);
        assertEquals(submission, clone);
         
        // Fetch it 
        MapSqlParameterSource params = new MapSqlParameterSource();
        params.addValue("id",submissionId);
        SubmissionDBO clone2 = dboBasicDao.getObjectByPrimaryKey(SubmissionDBO.class, params);
        assertNotNull(clone2);
        assertEquals(submission, clone2); 
         
        // Delete it 
        boolean result = dboBasicDao.deleteObjectByPrimaryKey(SubmissionDBO.class,  params);
        assertTrue("Failed to delete the entry created", result); 
    } 
  
} 
6
CodeRank
This code example shows how to use the following methods:addValue
		// Create it 
		assertNotNull(accessApproval);
		assertNotNull(accessApproval.getId());
		 
		// Fetch it 
		MapSqlParameterSource params = new MapSqlParameterSource();
		params.addValue("id", accessApproval.getId());
		DBOAccessApproval clone = dboBasicDao.getObjectByPrimaryKey(DBOAccessApproval.class, params);
		assertNotNull(clone);
		assertEquals(accessApproval, clone);
		 
		// Update it 
		dboBasicDao.update(clone);
		clone = dboBasicDao.getObjectByPrimaryKey(DBOAccessApproval.class, params);
		assertNotNull(clone);
		 
		// Delete it 
		boolean result = dboBasicDao.deleteObjectByPrimaryKey(DBOAccessApproval.class,  params);
		assertTrue("Failed to delete the type created", result);
	} 

6
CodeRank
See Code Examples for Spring Framework MapSqlParameterSource Methods: