Java Code Examples for org.springframework.samples.petclinic.model.Visit#setId()

The following examples show how to use org.springframework.samples.petclinic.model.Visit#setId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JdbcVisitRowMapper.java    From DevOps-for-Web-Development with MIT License 5 votes vote down vote up
@Override
public Visit mapRow(ResultSet rs, int row) throws SQLException {
    Visit visit = new Visit();
    visit.setId(rs.getInt("visit_id"));
    Date visitDate = rs.getDate("visit_date");
    visit.setDate(new LocalDate(visitDate));
    visit.setDescription(rs.getString("description"));
    return visit;
}
 
Example 2
Source File: JdbcVisitRepositoryImpl.java    From DevOps-for-Web-Development with MIT License 5 votes vote down vote up
@Override
public void save(Visit visit) throws DataAccessException {
    if (visit.isNew()) {
        Number newKey = this.insertVisit.executeAndReturnKey(
            createVisitParameterSource(visit));
        visit.setId(newKey.intValue());
    } else {
        throw new UnsupportedOperationException("Visit update not supported");
    }
}
 
Example 3
Source File: JdbcVisitRowMapper.java    From DevOps-for-Web-Development with MIT License 5 votes vote down vote up
@Override
public Visit mapRow(ResultSet rs, int row) throws SQLException {
    Visit visit = new Visit();
    visit.setId(rs.getInt("visit_id"));
    Date visitDate = rs.getDate("visit_date");
    visit.setDate(new Date(visitDate.getTime()));
    visit.setDescription(rs.getString("description"));
    return visit;
}
 
Example 4
Source File: JdbcVisitRepositoryImpl.java    From DevOps-for-Web-Development with MIT License 5 votes vote down vote up
@Override
public void save(Visit visit) throws DataAccessException {
    if (visit.isNew()) {
        Number newKey = this.insertVisit.executeAndReturnKey(
            createVisitParameterSource(visit));
        visit.setId(newKey.intValue());
    } else {
        throw new UnsupportedOperationException("Visit update not supported");
    }
}
 
Example 5
Source File: JdbcVisitRepositoryImpl.java    From docker-workflow-plugin with MIT License 5 votes vote down vote up
@Override
public void save(Visit visit) throws DataAccessException {
    if (visit.isNew()) {
        Number newKey = this.insertVisit.executeAndReturnKey(
                createVisitParameterSource(visit));
        visit.setId(newKey.intValue());
    } else {
        throw new UnsupportedOperationException("Visit update not supported");
    }
}
 
Example 6
Source File: JdbcVisitRepositoryImpl.java    From audit4j-demo with Apache License 2.0 5 votes vote down vote up
@Override
public void save(Visit visit) throws DataAccessException {
    if (visit.isNew()) {
        Number newKey = this.insertVisit.executeAndReturnKey(
                createVisitParameterSource(visit));
        visit.setId(newKey.intValue());
    } else {
        throw new UnsupportedOperationException("Visit update not supported");
    }
}