Skip to content

@OneToMany doesn't select join column because of missing join statement #84

@kopax

Description

@kopax

annotation @onetomany doesn't join column

It appear the @onetomany association doesn't work as expected.

version

I am using commit.

This is how I did the join table mapping, in SiteService.java :

@JdbcType(BIGINT)
@OneToMany
@JoinTable(name = "SITE_FUNCTION")
@JoinColumn(name = "SITE_SERVICE_ID")
@NotNull
private List<SiteFunction> siteFunctionList;

Result

Produce an empty array for siteFunctionList

Expected result

Produce an array using database data for siteFunctionList

The select method appear to not add any jointure for this table.

(but @manytoone association seems to work fine so far.)
The xml generated render an empty <sql id="SELECT_CONDITION_INNER"></sql>

What is it use for ?

There is this generated for the mapping by the annotations:

        <collection property="siteFunctionList" ofType="com.domain.security.SiteFunction">
            <id property="id" column="siteFunctionList.id" javaType="java.lang.Long" jdbcType="BIGINT"/>
            <result property="messageId" column="siteFunctionList.messageId" javaType="java.lang.String"
                    jdbcType="VARCHAR"/>
            <result property="name" column="siteFunctionList.name" javaType="java.lang.String" jdbcType="VARCHAR"/>
        </collection>

But nothing for selecting the field.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions