Spring Framework GeneratedKeyHolder - 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 GeneratedKeyHolder class.

This code example shows how to use the following methods:getKey
            serializedObj = mapper.serialize(obj); 
        } catch (Throwable e) { 
            throw new FullPetriClient.PetriException(e); 
        } 
 
        GeneratedKeyHolder keyHolder = new GeneratedKeyHolder(); 
        jdbcTemplate.update( 
                createInsertStatement(serializedObj, obj), 
                keyHolder); 
 
        Number id = keyHolder.getKey(); 
        if (id != null) { 
            postUpdate(id.intValue()); 
            return (T) jdbcTemplate.query(String.format(selectSql, id.intValue()), mapper).get(0); 
        } 
        throw new FullPetriClient.CreateFailed(obj.getClass(), identifierOf(obj)); 
    } 
 
    protected void postUpdate(int id) { 
        //To change body of created methods use File | Settings | File Templates. 
5
CodeRank
See Code Examples for Spring Framework GeneratedKeyHolder Methods: