We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following relation results (IMHO) in a wrong intermediate table (see below).
Entity A:
@Entity @Table(name = "measurement") public class MeasurementEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private Long id; @OneToMany private Set<AmbientSensorReadingEntity> ambientUsedForPreparation; @OneToMany private Set<AmbientSensorReadingEntity> ambientBefore; @OneToMany private Set<AmbientSensorReadingEntity> ambientAfter; // ... }
Entity B:
@Entity @Table(name = "ambient_sensor_reading") public class AmbientSensorReadingEntity{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id") private Long id; private double temperature; // ... }
Results in the following intermediate table, which can not be used by hibernate:
create table measurement_ambient_sensor_reading ( MeasurementEntity_id bigint not null, ambientUsedForPreparation_id bigint not null, ambientBefore_id bigint not null, ambientAfter_id bigint not null, primary key (MeasurementEntity_id, ambientAfter_id) ) engine=InnoDB;
If I change it to:
create table measurement_ambient_sensor_reading ( id bigint not null auto_increment, MeasurementEntity_id bigint not null, ambientUsedForPreparation_id bigint, ambientBefore_id bigint, ambientAfter_id bigint, primary key (id) ) engine=InnoDB;
Hibernate can correctly use the database. Do I miss some configuration or I am doing something else wrongly?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following relation results (IMHO) in a wrong intermediate table (see below).
Entity A:
Entity B:
Results in the following intermediate table, which can not be used by hibernate:
If I change it to:
Hibernate can correctly use the database. Do I miss some configuration or I am doing something else wrongly?
The text was updated successfully, but these errors were encountered: