Uploaded image for project: 'iBatis for Java [READ ONLY]'
  1. iBatis for Java [READ ONLY]
  2. IBATIS-718

pojo lost some fields when using ibatis 3.0.0.212

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.0 Beta 6
    • 3.0 Beta 6
    • Core
    • None
    • i386, windows XP, postgresql jdbc driver 8.4.-701 jdbc4, jdk build 1.6.0_17-b04,

    Description

      [sql script from mapper.xml]
      select
      book.isbn,
      book.title,
      book.first_author_first_name,
      book.first_author_last_name,
      book.second_author_first_name,
      book.second_author_last_name,
      book.price,
      book.pub_date_1st,
      pub.pub_name
      from
      schemax.t_book as book
      join
      schemax.t_pub_house as pub
      on
      book.pub_house_id = pub.pub_house_id
      where
      book.book_id = #

      {id}

      ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
      [issue]
      could get following fields correctly, always
      1. ISBN
      2. title
      3. price
      all other fields are "null" in java, always

      when using SQL client excute the script on database, all the fields show correctly.
      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
      [DDL script]
      CREATE TABLE schemax.t_book
      (
      book_id integer NOT NULL,
      isbn character(13) NOT NULL,
      title character(60) NOT NULL,
      first_author_first_name character varying(20) NOT NULL,
      first_author_last_name character varying(20) NOT NULL,
      second_author_first_name character varying(20),
      second_author_last_name character varying(20),
      price numeric NOT NULL,
      pub_date_1st date NOT NULL,
      pub_house_id integer,
      CONSTRAINT t_book_pkey PRIMARY KEY (book_id),
      CONSTRAINT t_book_pub_house_id_fkey FOREIGN KEY (pub_house_id)
      REFERENCES schemax.t_pub_house (pub_house_id) MATCH SIMPLE
      ON UPDATE CASCADE ON DELETE RESTRICT,
      CONSTRAINT t_book_book_id_key UNIQUE (book_id)
      )
      WITH (
      OIDS=FALSE
      );
      ALTER TABLE schemax.t_book OWNER TO gold;
      ---------------------------------------------------------------------
      – Table: schemax.t_pub_house

      – DROP TABLE schemax.t_pub_house;

      CREATE TABLE schemax.t_pub_house
      (
      pub_house_id integer NOT NULL,
      pub_name character varying(50) NOT NULL,
      address character varying(100),
      contact_number character varying(20),
      CONSTRAINT t_pub_house_pkey PRIMARY KEY (pub_house_id),
      CONSTRAINT t_pub_house_pub_house_id_key UNIQUE (pub_house_id),
      CONSTRAINT t_pub_house_pub_name_key UNIQUE (pub_name)
      )
      WITH (
      OIDS=FALSE
      );
      ALTER TABLE schemax.t_pub_house OWNER TO gold;
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------

      [test data]
      insert into schemax.t_pub_house (pub_house_id, pub_name, address, contact_number) values(1, 'oreally', 'wall street 001', '019-87654321');

      insert into schemax.t_book
      (book_id, isbn, title, first_author_first_name, first_author_last_name, second_author_first_name,
      second_author_last_name, price, pub_date_1st, pub_house_id)
      values
      (1, '1234567890123', 'hello world', 'tom', 'lee', 'todd', 'johnson', 15.6, '2009-1-1', 1);
      -----------------------------------------------------------------------------------------------------------------------------------------------------------
      [query script]
      select
      book.isbn, book.title, book.first_author_first_name, book.first_author_last_name, book.second_author_first_name, book.second_author_last_name, book.price, book.pub_date_1st, pub.pub_name
      from
      schemax.t_book as book
      join
      schemax.t_pub_house as pub
      on
      book.pub_house_id = pub.pub_house_id
      where
      book.book_id = 1
      ;
      ------------------------------------------------------------------------------------------------------------------------------------------------

      Attachments

        1. screenshot-1.jpg
          38 kB
          cqlang

        Activity

          People

            Unassigned Unassigned
            cq cqlang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment