Example usage for org.springframework.jdbc.core.simple SimpleJdbcInsert SimpleJdbcInsert

List of usage examples for org.springframework.jdbc.core.simple SimpleJdbcInsert SimpleJdbcInsert

Introduction

In this page you can find the example usage for org.springframework.jdbc.core.simple SimpleJdbcInsert SimpleJdbcInsert.

Prototype

public SimpleJdbcInsert(JdbcTemplate jdbcTemplate) 

Source Link

Document

Alternative Constructor that takes one parameter with the JdbcTemplate to be used.

Usage

From source file:org.smigo.plants.JdbcPlantDao.java

@Autowired
public void setDataSource(DataSource dataSource) {
    this.jdbcTemplate = new JdbcTemplate(dataSource);
    this.insertPlant = new SimpleJdbcInsert(dataSource).withTableName("plants").usingGeneratedKeyColumns("id")
            .usingColumns("x", "y", "year", "species_Id", "variety_Id", "user_Id");
}

From source file:au.org.ala.layers.dao.TaskDAOImpl.java

@Resource(name = "dataSource")
public void setDataSource(DataSource dataSource) {
    this.jdbcTemplate = new SimpleJdbcTemplate(dataSource);
    this.insertTask = new SimpleJdbcInsert(dataSource).withTableName("task").usingColumns("name", "json",
            "size");
}

From source file:org.springmodules.samples.cache.guava.repository.jdbc.JdbcPostRepository.java

@Autowired
public JdbcPostRepository(DataSource dataSource) {
    super.setDataSource(dataSource);

    insertPost = new SimpleJdbcInsert(dataSource).withTableName("posts")
            .usingColumns("user_name", "submit_date", "content").usingGeneratedKeyColumns("id");
}

From source file:org.smigo.species.vernacular.JdbcVernacularDao.java

@Autowired
public void setDataSource(DataSource dataSource) {
    this.jdbcTemplate = new JdbcTemplate(dataSource);
    this.insertVernacular = new SimpleJdbcInsert(dataSource).withTableName("VERNACULARS")
            .usingGeneratedKeyColumns("id")
            .usingColumns("species_id", "vernacular_name", "language", "country");
}

From source file:org.cbarrett.lcbo.db.LCBONewProductDAOImpl.java

public void setDataSource(DataSource dataSource) {
    this.simpleJdbcTemplate = new SimpleJdbcTemplate(dataSource);
    this.insertDataset = new SimpleJdbcInsert(dataSource).withTableName("NEW_PRODUCTS");
}

From source file:com.nebhale.cyclinglibrary.repository.JdbcCollectionRepository.java

@Autowired
JdbcCollectionRepository(DataSource dataSource) {
    this.jdbcTemplate = new JdbcTemplate(dataSource);
    this.createStatement = new SimpleJdbcInsert(dataSource).withTableName("collections")
            .usingGeneratedKeyColumns("id");
}

From source file:org.smigo.user.JdbcUserDao.java

@Autowired
public void setDataSource(DataSource dataSource) {
    this.jdbcTemplate = new JdbcTemplate(dataSource);
    this.insert = new SimpleJdbcInsert(dataSource).withTableName("users").usingGeneratedKeyColumns("id")
            .usingColumns("username", "locale", "termsofservice", "email", "displayname", "decidetime", "about",
                    "password");
    this.insertOpenId = new SimpleJdbcInsert(dataSource).withTableName("openid").usingGeneratedKeyColumns("id");
}

From source file:com.neeti.neg.dao.impl.RegisterUserDaoImpl.java

@Autowired
public void setDataSource(DataSource dataSource) {
    this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
    this.insertUser = new SimpleJdbcInsert(dataSource).withTableName("user")
            .usingColumns("groupname", "grouppassword", "teammembers", "email", "enabled")
            .usingGeneratedKeyColumns("groupid");
}

From source file:com.nebhale.cyclinglibrary.repository.JdbcTypeRepository.java

@Autowired
JdbcTypeRepository(DataSource dataSource) {
    this.jdbcTemplate = new JdbcTemplate(dataSource);
    this.createStatement = new SimpleJdbcInsert(dataSource).withTableName("types")
            .usingGeneratedKeyColumns("id");
}

From source file:com.nebhale.cyclinglibrary.repository.JdbcItemRepository.java

@Autowired
JdbcItemRepository(DataSource dataSource) {
    this.jdbcTemplate = new JdbcTemplate(dataSource);
    this.createStatement = new SimpleJdbcInsert(dataSource).withTableName("items")
            .usingGeneratedKeyColumns("id");
}