many-to-one Questions
1
Solved
I'm having difficulty representing this query (which works on the database directly) as a criteria query in Hibernate (version 3.2.5):
SELECT s.*
FROM ftp_status s
WHERE (s.datetime,s.connecti...
Alkalify asked 27/4, 2010 at 18:15
2
I have two base abstract classes and there are multiple additional classes derived from these two, adding additional attributes etc.
There exist relations between those specific derived types.
A ...
Marsiella asked 5/9, 2011 at 23:9
1
Solved
I'm asking and answering my own question, but i'm not assuming i have the best answer. If you have a better one, please post it!
Related questions:
How to set a backreference from an @EmbeddedId i...
Friendly asked 25/8, 2011 at 19:19
2
Solved
I've those 2 entities
Class A {
@OneToMany(mappedBy="a")
private List<B> bs;
}
Class B {
@ManyToOne
private A a;
private String name;
}
1) I would like to construct a query that sa...
Vizza asked 3/7, 2011 at 17:59
2
Solved
I am using Hibernate with spring.
I have a model-class like this.
@Entity
@Table(name = "forumtopic")
public final class Forumtopic extends AbstractUserTracking implements
java.io.Serializable...
Drier asked 8/4, 2011 at 11:20
3
Solved
I have a table where the the parent object has an optional many-to-one relationship. The problem is that the table is setup to default the fkey column to 0.
When selecting, using fetch="join", et...
Rotund asked 13/1, 2011 at 3:48
2
Solved
I have two entities:
@Entity
public class File
.......
@Id @GeneratedValue(strategy=GenerationType.AUTO)
private int id;
@OneToMany(fetch=FetchType.LAZY, mappedBy="file", cascade=CascadeType.ALL)
...
Kirtle asked 21/12, 2010 at 5:33
2
Solved
I have the following annotated Hibernate entity classes:
@Entity
public class Cat {
@Column(name = "ID") @GeneratedValue(strategy = GenerationType.AUTO) @Id
private Long id;
@OneToMany(mappedB...
Bimetallism asked 27/5, 2010 at 13:3
2
I am working on a JPA project. I need to use a @OneToMany mapping on a class that has three primary keys. You can find the errors and the classes after this.
javax.persistence.PersistenceExceptio...
Nasion asked 28/4, 2010 at 8:56
2
Solved
I'm piggy-backing off of How to join tables in unidirectional many-to-one condition?.
If you have two classes:
class A {
@Id
public Long id;
}
class B {
@Id
public Long id;
@ManyToOne
@Joi...
Integrity asked 4/3, 2010 at 23:18
© 2022 - 2024 — McMap. All rights reserved.