java - insert into select with jpa error -
I am trying to put one in the selection with Jepa. The unit I try to do this is like this:
@Entity Public Category A {Private string field one; Private string field two; Private string field three; Private B Fieldfour; @Id public string getFieldOne () {...} @ id public string getFieldTwo () {...} @ id @ ontok a public b getFieldThree () {...} public string getFieldFour () {...}. . @ Entity Public Sector B {Personal Composite ID; .... @ embedded id public composite id () {return MyUUIDGenerator.generateCompositeId (); } ....
I'm trying to get involved very simple:
A (Field O, Field Two, FieldTree , Fieldfur) Choose 'Static Wells', 'Static Valve To', BID, 'Static Value Fear', where? ....
The value of 'staticvlex' is the calculation of those applications Those who should all be equal to B for any given set of elements.
Returns the exception of the application during execution:
java.lang.IllegalArgumentException: org.hibernate.QueryException: Can only generate IDs, either sequence or post- Part of the bulk with the dart style generator [insert ...
I do not understand, because I do not have any generated values in A. I have all the necessary values Insert.
Edit: little update ...
I have changed only one field in the string type has been marked as an ID, But hibernation makes errors in making the query correctly: The combination of field names with field names remembers a few fields.
/ Strong>:
A Java continuity query language statement can either be a statement, an update statement, or a statement can be removed. (...)
In the BNF syntax, a query language statement is defined:
QL_statement :: = select_statement | Update_statement | Delete_statement
Instead of the SELECT statement, which is not supported in JPA (either JPQL or Criteria API), inside an entity
ElementManager.persist
Use Transaction When the transaction takes place, the entity is written in the database (SQL INSERT will be implied by Hibernate which acts as a stubborn provider).EDIT: In the case of a large number of inclusions, you can keep a closer look. Another option on hibernate batch inserts is to leave JPA and directly to JDBC's Use batch entry (
created state
).
Comments
Post a Comment