question « Collection « JPA Q&A





1. Security question: how to secure Hibernate collections coming back from client to server?    stackoverflow.com

I've got a simple pojo named "Parent" which contains a collection of object "Child". In hibernate/jpa, it's simply a one-to-many association, children do not know their parent: these Child objects can have ...

2. collection of extents question    forum.hibernate.org

So I have a rather complex mapping I'm trying to accomplish. I have an object ("message") that can contain multiple children ("attributes") in a one-to-many relationship. The children represent an extent or system of subclasses. So there's BaseAttribute, FooAttribute, BarAttribute, etc. There can be zero to many of each kind of attribute associated with the message, but at most one of ...

3. Question on creating an ad-hoc collection    forum.hibernate.org

4. Collection question.    forum.hibernate.org

HI alls. I've got 3 tables. Company (id, name) Property(id, name, ref_id, lang_id) Language(id, name) in Company class; public class Company { private List properties; /** * @hibernate.bag inverse="false" * table="multilanguage_property" * lazy="false" * cascade="all" * inverse="true" * where="disc like 'comp'" * @hibernate.collection-key column="ref_id" * @hibernate.collection-one-to-many * class="com.clearview.feedback.db.language.MultiLanguageProperty" * @return */ public List getProperties() { return properties; } public void setProperties(List ...

5. question about saveOrUpdate and collections...    forum.hibernate.org

This question revolves around using saveOrUpdate() to save a 'child' or the 'many' of a one-to-many relationship. The collection definition in the 'parent' mapping file: Code: The issue is this; i get a Program object and update an attribute via ...

6. newbie Collections question!    forum.hibernate.org

7. lazily initialized collections question    forum.hibernate.org

8. One-to-many Collection question    forum.hibernate.org

I have a question about one-to-many collections. I have the following two classes. Code: ...

9. One-to-many Collection question    forum.hibernate.org

I have a question about one-to-many collections. I have the following two classes. Code: ...





10. Collection Question    forum.hibernate.org

11. Collection of dependent objects question    forum.hibernate.org

Hello, I've got a question regarding the example from chapter 7.2 of the documentation: In this case "id" is the foreignkey to the enclosing table. Am I correct? Is it possible that table 'some_names' has its own synthetized primary key ...

12. Collection of dependent objects question    forum.hibernate.org

Hello, I've got a question regarding the example from chapter 7.2 of the documentation: In this case "id" is the foreignkey to the enclosing table. Am I correct? Is it possible that table 'some_names' has its own synthetized primary key ...

14. Newbie HQL question regarding collections    forum.hibernate.org

I'm sure there has to be an easy way to do this, but, I'm just not seeing it right now. I'm trying to do something like the following, but, it's not working. SELECT c FROM mypackage.Course c WHERE c.sections.term.startTime > '2004-12-01' The way my model is setup, a course has many sections, and a section has a single term which has ...

15. another could not initialize collection question    forum.hibernate.org

Hello all, After i(literally) read every post about "could not initialize collection:" and couldn't find anything like my problem i decided to ask if any of have a clue about it. What seems to be the problem is the big size of the query hibernate is generating (about 11000 chars) and the stacktrace starts with a SQLException. Running the generated query ...

16. Collection design question    forum.hibernate.org

Hi everyone, I'm a newbie and i just have a design question to do with collections. I just want to make sure my design is right before i start my hibernate implementation so any advice you can provide will be greatly appreciated. I have two tables, Order and OrderLine with a one-to-many relationship. Currently the tables look something like this. Order ...





17. Many to One Collection Syntax Question    forum.hibernate.org

Hibernate version: 3.0.3 Mapping documents: Code between sessionFactory.openSession() and session.close(): String sql = "from User"; Session s = HibHelper.getSession(); Query q ...

18. Collections question, stuck on something that should be easy    forum.hibernate.org

If each A can have several Bs, I have no problem defining a one-to-many map that gives me the map of Bs, in A's hbm.xml. It works great. However, I can't figure out, if I _only_ have a table of Bs, how to define a map in B's hbm.xml, of all the B's. That is, I want a way to fetch ...

19. Collection Loader Questions    forum.hibernate.org

Hibernate version:3.1RC1 Database: SQL Server 2000 Hi, 1) I can't seem to get collection loaders to work at all. I made my mapping as close to the example from the documentation (down below) and Hibernate just ignores the element. In other words, the behavior is the exact same whether or not is there (and it is odd behavior, ask ...

20. questions about persisting collections    forum.hibernate.org

Im using hibernate 3. I can persist a list with a composite-element (mapped to another class), but not with a one-to-many. With one2many I dont get any errors, but nothing gets saved or hydrated. here's the mapping (the one-to-many i tried is commented). If I use composite-element, i dont need to map GameActions, but that is what i tried with one2many... ...

21. Question on Collection    forum.hibernate.org

Hi, I am using Hibernate 3.1 version. Is it possible that hibernate can return a collection in which some of the elements are null? I am experiencing a strange problem. I have one-to-many relationship between A and B and when I do A.getB() hibernate is giving me a collection of B. Hibernate is returning a collection with expected results but also ...

22. Criteria API question - OR-ing over 2 collections    forum.hibernate.org

I have a class with a couple of collections.. public class Project private List organisations; private List contacts; And in a certain case, I'd like to return all Projects for which a supplied Organisation id matches an Organisation in the 'organisations' collection, OR for which a supplied Person ID matches a Person in the 'contacts' collection. I can run a search ...

23. HQL question - Collection equality    forum.hibernate.org

Hello, How can I check if a given collection parameter is a subset of an entity's association? For example, imagine we have a Person that has a list of places he/she has visited, namely locations. How can I get a list of persons who have visited an arbitrary list of locations? Something like :collectionParameter is memberOf person.locations. Is this a valid ...

24. Question about collections    forum.hibernate.org

25. Question about collections    forum.hibernate.org

26. optimization question regarding collections    forum.hibernate.org

27. Question regarding Persistent Collection Semantics    forum.hibernate.org

Let's say I have a one-to-many Parent-Child relationship and a Service method that looks like this: Code: saveParent(Parent parent, List children); Let's also say that the Children are already persistent, but the Parent is not before calling this method. So, in a loop I do: Code: parent.addChild(child) using the usual add-to-list-associate-with-parent stuff. Then I go and save the Parent, but bomb ...