Package org.springframework.jdbc.core.simple

Examples of org.springframework.jdbc.core.simple.SimpleJdbcInsert


   private SimpleJdbcInsert bookInsert;

   @Autowired(required = true)
   public void initialize(final DataSource dataSource) {
      this.jdbcTemplate = new SimpleJdbcTemplate(dataSource);
      this.bookInsert = new SimpleJdbcInsert(dataSource).withTableName("books")
               .usingGeneratedKeyColumns("id");
   }
View Full Code Here


    // ~ Methods =============================================================

    public void setInsertAudit(DataSource dataSource) {
        logger.debug("Setou o DataSource");
        this.insertAudit = new SimpleJdbcInsert(dataSource)
                                .withTableName(tableName)
                                .usingGeneratedKeyColumns(columnId);
    }
View Full Code Here

  @Autowired
  public void init(DataSource dataSource) {
    this.simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);

    this.insertOwner = new SimpleJdbcInsert(dataSource)
      .withTableName("owners")
      .usingGeneratedKeyColumns("id");
    this.insertPet = new SimpleJdbcInsert(dataSource)
      .withTableName("pets")
      .usingGeneratedKeyColumns("id");
    this.insertVisit = new SimpleJdbcInsert(dataSource)
      .withTableName("visits")
      .usingGeneratedKeyColumns("id");
  }
View Full Code Here

    };

    @Autowired
    public CompanyDAO(DataSource dataSource, IIndustryDAO industryDAO) {
        this.template = new SimpleJdbcTemplate(dataSource);
        this.insertCompany = new SimpleJdbcInsert(dataSource).withTableName("COMPANY").usingGeneratedKeyColumns("ID");
        this.industryDAO = industryDAO;
    }
View Full Code Here

    }

    @Autowired
    public IndustryDAO(DataSource dataSource) {
        this.template = new SimpleJdbcTemplate(dataSource);
        this.insertIndustry = new SimpleJdbcInsert(dataSource).withTableName("INDUSTRY").usingGeneratedKeyColumns("ID");
    }
View Full Code Here

        }
    };

    public ContactDAO(DataSource dataSource) {
        this.template = new SimpleJdbcTemplate(dataSource);
        this.insertContact = new SimpleJdbcInsert(dataSource).withTableName("CONTACT").usingGeneratedKeyColumns("ID");
    }
View Full Code Here

    @Autowired
    public JdbcOwnerRepositoryImpl(DataSource dataSource, NamedParameterJdbcTemplate namedParameterJdbcTemplate,
                                   VisitRepository visitRepository) {

        this.insertOwner = new SimpleJdbcInsert(dataSource)
                .withTableName("owners")
                .usingGeneratedKeyColumns("id");

        this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
View Full Code Here

    @Autowired
    public JdbcVisitRepositoryImpl(DataSource dataSource) {
        this.jdbcTemplate = new JdbcTemplate(dataSource);

        this.insertVisit = new SimpleJdbcInsert(dataSource)
                .withTableName("visits")
                .usingGeneratedKeyColumns("id");
    }
View Full Code Here

    @Autowired
    public JdbcPetRepositoryImpl(DataSource dataSource, OwnerRepository ownerRepository, VisitRepository visitRepository) {
        this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);

        this.insertPet = new SimpleJdbcInsert(dataSource)
                .withTableName("pets")
                .usingGeneratedKeyColumns("id");

        this.ownerRepository = ownerRepository;
        this.visitRepository = visitRepository;
View Full Code Here

    catch (SQLException e) {
      e.printStackTrace();
    }

    if (printJob.getJobId() == AbstractPrintJob.UNSAVED_ID) {
      SimpleJdbcInsert insert = new SimpleJdbcInsert(template)
              .withTableName(TABLE_NAME)
              .usingGeneratedKeyColumns("jobId");
      Number newId = insert.executeAndReturnKey(params);
      printJob.setJobId(newId.longValue());
    }
    else {
      params.addValue("jobId", printJob.getJobId());
      NamedParameterJdbcTemplate namedTemplate = new NamedParameterJdbcTemplate(template);
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.simple.SimpleJdbcInsert

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.