Closed rjbgaspar closed 9 months ago
@rjbgaspar can you contribute with a PR?
Hi @mshima,
As I mentioned in the other issue, I don't have the project knowledge to do it.
Go to this folder and replace id
with <%- primaryKey.name %>
(<%- relationship.otherEntity.primaryKey.name %>
) for relationships) whenever applicable.
@mshima is it normal that the backend sends this for a one-to-one relationship?
@mshima is it normal that the backend sends this for a one-to-one relationship?
I don't think so.
I generate same entities with Vue
and Angular
and the backend code is different
Vue
@Table("player")
@SuppressWarnings("common-java:DuplicatedBlocks")
public class Player implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column("id")
private Long id;
@Column("name")
private String name;
@Transient
private Foot foot;
@Column("foot_id")
private Long footId;
Angular
@Entity
@Table(name = "player")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@SuppressWarnings("common-java:DuplicatedBlocks")
public class Player implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
@Column(name = "name")
private String name;
@JsonIgnoreProperties(value = { "player" }, allowSetters = true)
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(unique = true)
private Foot foot;
The first looks reactive, the second looks imperative.
ah yes thanks 👍
Overview of the issue
In case we use a primary key with a name other then id the vuejs frontend incorrect generated.
Motivation for or Use Case
n.a.
Reproduce the error
Generate a new project using the JDL provided in "JHipster configuration" section, start the project, go to “Employees” entity and you wont be able to see the id.
Related issues
n.a.
Suggest a Fix
Change the files responsible for generating the vuejs frontened, to mach the appropriated key.
It should target the
JHipster Version(s)
Release 7.9.4 (2023-09-05)
JHipster configuration
The following JDL can be use to demonstrate the issue
JDL definitions
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryn.a.
Browsers and Operating System
n.a.