I have two objects in my model:
@Entity
@Table(name = "project")
@Getter
@Setter
public class Project extends BaseData{
...
private PaymentMethod paymentMethod;
...
}
.
@Getter
@Setter
public class PaymentMethod {
private Boolean requestRequired;
private Integer timeLimit;
}
What I want to do is to map requestRequred
and timeLimit
fields on columns of project
table so there is no need to create one more table to store PaymentMethod
objects in.
Is it possible in general and is it a common practice to do this? It seems a little bit counterintuitive for me and difficult to maintain. But on the other side a lot of tables lead to performance issues as far as I know.
Thanks for help!