开发者

Its possible insert row with embedded ID on table with HQL?

I'm able to insert any row with HQL.

Example:

insert into MyMappedTable(field,field,field) select c.x, c.y, c.z from Object c where ....
开发者_JS百科

But, my requirement is insert with embedded Id

@JoinColumn(insertable = false, name = "CATEGORYID", referencedColumnName = "ID", updatable = false)
@ManyToOne(fetch = FetchType.EAGER, optional = false)
private Category category;

@EmbeddedId
protected CategoryProductPK categoryProductPK;

@Basic(optional = true)
@Column(name = "POSITION")
private Integer position;

@JoinColumn(insertable = false, name = "PRODUCTID", referencedColumnName = "ID", updatable = false)
@ManyToOne(fetch = FetchType.EAGER, optional = false)
private Product product;

Is possible with HQL?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜