one-to-many Questions
10
Solved
I have two entities, an entity "movie" and an entity "Clip"
each clip belongs to one movie and a movie can have multiple clips.
My code looks like:
Movie.java
@OneToMany(mapped...
Evin asked 16/5, 2013 at 2:10
8
Solved
If I have a many-to-many relationship it's super easy to update the relationship with its sync method.
But what would I use to synchronize a one-to-many relationship?
table posts: id, name
table...
Exobiology asked 29/11, 2014 at 16:37
3
The error
Cannot delete or update a parent row: a foreign key constraint fails.
The classes
class Teacher {
/**
*@ORM\OneToMany(targetEntity="publication", mappedBy="teacher")
*/
protected ...
Biddable asked 13/1, 2012 at 23:29
2
Solved
I'm working on forum template using Flask. When I attempt creating a new thread in the browser using forms, SQLAlchemy throws an AttributeError. The problem showed up when I tried implementing a on...
Decentralization asked 22/4, 2013 at 16:12
2
Solved
I'm working on a Java project using JPA 2 + Hibernate 4.2.6 and I'm getting a strange behaviour.
In my model I have two related entites: Question and Answer
@Entity
public class Question {
// .....
Daughter asked 23/12, 2013 at 19:18
2
Solved
I have two simple beans--FatKid and Hamburgers. I need to be able to not only look up all of the hamburgers someone ate, but also who ate which particular hamburger.
FatKid.java
import java.util.Li...
Atlas asked 23/10, 2011 at 21:45
18
Solved
Hibernate throws this exception during SessionFactory creation:
org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags
This is my test case:
Parent.java
@E...
Aristocracy asked 2/12, 2010 at 12:28
3
Solved
I have 3 sqlalchemy models setup which are all one to many relationships. The User model contains many Task models and the Task model contains many Subtask models. When I execute the test_script.py...
Isis asked 23/6, 2019 at 3:2
2
Solved
In my Dymfony2 / Doctrine2 application, I have a oneToMany relation between an object and its children.
I want to select all objects which have no children.
I'm stuck with various errors: SingleV...
Spongy asked 25/5, 2015 at 19:40
15
Solved
It's my first question here on stack, so please be gentle :D
I'm trying to create hibernate OneToMany relationship. When I try to fetch some data from my DB, I'm getting StackOverflowError. But whe...
Wreathe asked 3/7, 2013 at 10:30
11
Solved
I'm defining my Django models right now and I realized that there wasn't a OneToManyField in the model field types. I'm sure there's a way to do this, so I'm not sure what I'm missing. I essentiall...
Bathysphere asked 3/8, 2011 at 15:7
15
Solved
What is the real difference between one-to-many and many-to-one relationship? It is only reversed, kind of?
I can't find any 'good-and-easy-to-understand' tutorial about this topic other than this...
Roslynrosmarin asked 5/1, 2011 at 7:23
4
Solved
I have 2 classes in a one-to-many relationship and a HQL query that is a bit strange. Even if I have read some questions already posted, it does not seem clear to me.
Class Department{
@OneToMany...
Hard asked 11/9, 2013 at 23:59
3
Solved
I am using javax.persistence.OneToMany relationship in a Parent Child relationship. The parent Id is coming as null, I have read through all the related post in Stackoverflow but not getting any cl...
Justin asked 11/4, 2017 at 22:45
2
Solved
I want to create two tables one with comments and another with replies, with a one to many relationship between them. But what if they can also reply to replies, how should it be changed then? This...
Downhaul asked 21/11, 2012 at 9:57
6
Solved
I have two tables with foreign key relations. I've tried searching on how to do it and it always leads to OneToMany & ManyToOne mapping. I have these two tables.
user_role
user
I'm tryin...
Reseda asked 20/9, 2018 at 3:5
3
I have a composite key ContractServiceLocationPK made out of three id's (contractId, locationId, serviceId) of type long in an embeddable class. The class which uses this composite key, ContractSer...
Tabitha asked 19/5, 2014 at 11:20
7
Solved
I need something similar to these 2 SO questions, but using Informix SQL syntax.
Concatenate several fields into one with SQL
SQL Help: Select statement Concatenate a One to Many relationship
...
Conners asked 3/4, 2009 at 19:30
2
Solved
I am trying to configure a relationship between to entities in EFCore: Square and Position. Position has one (position) to many (squares) relationship with square named squares, as well as two one ...
Hosiery asked 4/6, 2021 at 9:1
6
Solved
I start showing you my scenario.
This is my parent object:
@Entity
@Table(name="cart")
public class Cart implements Serializable{
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Id
@Colum...
Mallorie asked 6/12, 2018 at 8:52
1
Solved
I am trying to setup a one-to-many relationship, I have checked various articles and tutorials online but all the examples show one table having a one to many relationship with another table.
In my...
Headrail asked 1/4, 2021 at 1:4
2
Solved
I'm trying to figure out what I can possibly be doing wrong (or, of course, misunderstood about relationships, fetches and all).
In a first search, when I read the question's title, I hoped this q...
Derogatory asked 14/6, 2020 at 15:18
3
Solved
My problem is that hibernate retrieve null in the value of the @OneToMany Set organizationMemberCollection when fetching an instance on the following object :
UserAccount.java :
@Entity
@Table(n...
Seditious asked 23/3, 2016 at 16:44
4
Let's say I have the following situation:
Object Car has an ArrayList of prices, which are all numbers. Is it possible in Hibernate to save all the prices in a single column? I know this violates...
Vermicular asked 4/5, 2013 at 11:32
5
i have a bidirectional, one to many, and many to one relationship. say, a Company has many Persons, and a Persons has one company, so, in company,
@OneToMany(mappedBy = "company", fetch = FetchTyp...
Revenant asked 26/2, 2011 at 0:28
1 Next >
© 2022 - 2024 — McMap. All rights reserved.