mybatis « Operation « Java Database Q&A





1. MyBatis 3.0.1 insert problem    stackoverflow.com

Decided to move one of my project from iBatis to MyBatis and ran into a problem with insert. mapper xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"    ...

2. How do I insert collection of objects using MyBatis 3.x?    stackoverflow.com

I'm a beginner with MyBatis. I just want to know how to insert a collection of objects from an instance of a class. Say I have a class User related to a ...

3. How to use Annotations with iBatis (myBatis) for an IN query?    stackoverflow.com

We'd like to use only annotations with MyBatis; we're really trying to avoid xml. We're trying to use an "IN" clause:

@Select("SELECT * FROM blog WHERE id IN (#{ids})") 
List<Blog> selectBlogs(int[] ...

4. MyBatis: How to return the ID of the inserted object under Postgres?    stackoverflow.com

I've got a postgres table where the ID is defined as bigserial. How can I use @Insert and get back the id of the inserted entity? I am expecting the mapper method to ...

5. Inserting child objects in MyBatis    stackoverflow.com

I have a very simple object graph that I want to store in a database using MyBatis. If I make a brand new object graph (a BatisNode with two details), ...

6. MyBatis mapping properties to database columns when inserting & updating (using annotations)    stackoverflow.com

I'm just starting to learn MyBatis and I'm wondering, when I'm creating insert or update queries, is there a way that I can make property names a bit more friendly to ...

7. What does insert(), delete(), select() and update() of the MyBatis SqlSession Interface return?    stackoverflow.com

From the API Doc of mybatis i can just see, that insert, delete, select and update has an int as the returntype. But there is no documentation about what the meaning ...

8. How do I query subset of columns from PostGIS using MyBatis?    stackoverflow.com

I'm trying to query data from a PostGIS database using MyBatis, ignoring the geospatial data. I have the following table in the database:

CREATE TABLE salesgeometry
(
  id bigint NOT NULL,
  ...

9. Getting update counts for a batch insert/update in ibatis    stackoverflow.com

Using the latest version of mybatis. Have a mapper and DAO. Doing batch inserts. Its working but I want to know how many rows were inserted. In JDBC I can get ...