can not get array type of PostgreSQL through QueryDslJdbcTemplate/Spring-Data #484

Closed
nabedge opened this Issue Aug 26, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@nabedge

nabedge commented Aug 26, 2013

I would like to access the array type column on postgresql through QueryDslJdbcTemplate and spring-data .

TABLE DDL and DML:

  create schema qdslsampleuser;
  create table mytable (
      id bigint primary key
      ,myarray varchar(8)[]
  );
  insert into mytable (id, myarray) values (1, array['a','b','c']);

The code:

  @RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(locations = { "classpath:applicationContext.xml" })

  public class SimpleTest {

    private static Logger logger = LogManager.getLogger();

    @Autowired
    private QueryDslJdbcTemplate qdslTemplate;

    @Test
    public void queryDslSample01() {
        logger.info("******** queryDslSample01 START ********");
        SQLQuery query = qdslTemplate.newSqlQuery();

        QMytable qMytable = QMytable.mytable;
        query.from(qMytable).where(qMytable.id.eq(Long.parseLong("1")));
        Mytable mytable = qdslTemplate.queryForObject(query, qMytable);

        // SQL statement will be executed.
        // But I can not get the resultSet as Mytable instance !
        logger.info("******** queryDslSample01 END {}", mytable.getMyarray()

                .toString());
    }

This test will fail.
How to do that ?

All the sample code is on github.com

  1. install postgresql9.x on localhost
  2. git clone https://github.com/nabedge/qdsl-springdata-sample.git
  3. mvn clean test (including querydsl metaclass generation)

timowest added a commit that referenced this issue Aug 26, 2013

@nabedge

This comment has been minimized.

Show comment
Hide comment
@nabedge

nabedge Aug 27, 2013

Thank you Timo.
Would you tell me about is this bug or not ?
Should I version up to 3.x from 2.9.0.FIXED ?
But I can not use new one because I 'm using spring-data-jdbc-core that depends on 2.9.x .

Are there any work-arround ?

nabedge commented Aug 27, 2013

Thank you Timo.
Would you tell me about is this bug or not ?
Should I version up to 3.x from 2.9.0.FIXED ?
But I can not use new one because I 'm using spring-data-jdbc-core that depends on 2.9.x .

Are there any work-arround ?

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Aug 27, 2013

Member

Using JDBC arrays is not yet supported.

Member

timowest commented Aug 27, 2013

Using JDBC arrays is not yet supported.

@timowest timowest closed this in #899 Aug 31, 2014

@timowest timowest added this to the 3.5.0 milestone Aug 31, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Sep 30, 2014

Member

Released in 3.5.0

Member

timowest commented Sep 30, 2014

Released in 3.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment