Questions tagged [joincolumn]
82 questions
0
votes
0 answers
Java Spring @JoinColumn with nvarchar and numeric Spring 3
I am trying to update a service from Spring 2 to Spring 3.
Before, the @JoinColumn(name = "an_nvarchar_col", referencedColumnName = "a_numeric_col") is working fine in Spring 2.x.x.
Now updated to Spring 3.x.x, it throws an error
Caused by:…
0
votes
2 answers
How to @joincolumn key from table a with foreign key in table b in JPA/Spring
how do I link via @joincolumn an already existing key from table A with a field in table B.
In detail I have a class server with its key serverId. It has a one-to-one relation to a class license linked by the serverId from the embedded Class…

LikeMyDog_22
- 3
- 3
0
votes
2 answers
in spring boot how to insert Data to joined table after joining two tables
i have created a spring boot project with two tables Employee and Department which i want to join it by many employee and can have one department i have made the @onetomany and @manytoone in the respective tables i get the column in Employee Table…
0
votes
0 answers
Repeated primary key in mapping for 2 tables
@OneToMany(mappedBy = "subjects")
private Set teachers;
@ManyToMany(mappedBy = "subjects")
private Set subjects;
I have used 2 joining with 1 primary key in spring boot. At that time, I got an error…
0
votes
1 answer
hibernate @joincolumns with insertable true not allowing insert
I have a couple of tables with relation as in the image below
I created hibernate data model as follows
@Entity
@Table(name = "SUBJECT")
public class Subject {
@Column(name = "NAME")
private String name;
@Column(name = "ADDRESS")
private…

techBeginner
- 3,792
- 11
- 43
- 59
0
votes
0 answers
Hibernate/JPA: ManyToOne to behave as LEFT OUTER JOIN instead of foreign Key
I have two entity: Person and Email. The relationship between them is ManyToOne. The idea is Every household will have one email - and all the person in a house will share same email.
I also have a case where few households doesn't have email…

Kumar
- 1,536
- 2
- 23
- 33
0
votes
1 answer
On which side must I define a @JoinColumn annotation for a @OneToOne relationship like this?
Say I have a relationship like figure 1 (@OneToOne between Customer and AtmCard, mandatory on one side but not the other).
Am I correct to say that to enforce the mandatory aspect of the Customer on the AtmCard side, I need to future define a…

FlyingSquid
- 57
- 6
0
votes
0 answers
@joinedcolumn not correctly mapped by hibernate
I'm facing an issue when running unit test with hibernate trying to make some tests against my repository (spring boot+jpa application). below the config i'm using
It consists of 3 entities Record, Order an Status:
@Table(name = "T_RECORD")
public…

le-cardinal
- 69
- 3
0
votes
1 answer
how to pass parameter value into query in spring boot for join column?
This is the code for bill entity, i have variable of group and the table name is gid
This is the bill repository, i have tried both the commented and the non commented part, both are not working. It says not matching types.
0
votes
1 answer
Express + Typescript ° TypeORM = TypeError: Cannot read property 'joinColumns' of undefined
I am struggling, I have two entities linked by OneToMany (Marketplace -> Annonce), I can fetch the marketplace from annonce, but i can't fetch annonces from marketplace, It only works when it is eager but no way i make it from with lazy mode.
I…

fallous
- 31
- 6
0
votes
1 answer
Join non-unique column in spring jpa
I was hopping to find an answer to my probleme on this here forum. My problem is as follows, I have two classes :
@Entity
@Table(name = "a")
public class A implements Serializable{
@Id
private String id = UUID.randomUUID().toString();
…

Anas Lemcirdi
- 1
- 1
0
votes
2 answers
Why does PSQL complain about unknown relation: org.postgresql.util.PSQLException: ERROR: relation "benannte_person" does not exist?
When I try to run a SpringBootTest using Testcontainers, I get a
org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not…

du-it
- 2,561
- 8
- 42
- 80
0
votes
1 answer
Multi joinColumn Jpa
Hi everyone and thanks for your attention!.
Like title says i'm facing a problem trying to connect 3 entities in jpa, where two of them are connected with 3 keys (one Pk and two Fks). i create a simple project on github that works perfectly but i…

Michael Cauduro
- 185
- 1
- 3
- 16
0
votes
0 answers
JPA @JoinFormula with BindParameter
I have a @OneToOne relationship described as below:
@OneToOne
@JoinColumnsOrFormulas(
{
@JoinColumnOrFormula(
column = @JoinColumn(name = "PRODUCT_ID", referencedColumnName = "PRODUCT_ID", insertable =…

regisxp
- 956
- 2
- 10
- 31
0
votes
1 answer
Spring Boot application join doesn't work
My join between user and authority isn't seem to be working.
Here are my classes:
@Entity
@Table(name="users")
public class User {
public static final PasswordEncoder PASSWORD_ENCODER = new BCryptPasswordEncoder();
…

runnerpaul
- 5,942
- 8
- 49
- 118