Its possible insertion string with built-in identifier on a table with HQL?

I can insert any string with HQL.

Example:

insert into MyMappedTable(field,field,field) select c.x, c.y, c.z from Object c where ....

But my requirement is insert with inline 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 it possible using HQL?

+3
source share

All Articles