subclass 2 « Map « JPA Q&A





1. Table per Subclass - Child added in Parent Table?!    forum.hibernate.org

Hello, I have a simple structure: XYDiagram extends Diagram extends DiagramBase. I want Hibernate to use the Table-per-Subclass inheritance strategy. Everything is working fine so far but hibernate persists the child objects in the parent table. Example: I have an object of the type XYDiagram. I want to persist it. Hibernate inserts the object in the Table DiagramBase and not in ...

2. Subclasses with discriminators with subclass collections    forum.hibernate.org

Hi, I have been playing around with code and searching forums to no avail. Maybe someone here knows how to solve the following issue: Abstract class A has B, C and D as subclasses. In SQL, these are represented by one table with a discriminator column. Interface V is implemented by X, Y, and Z. In SQL, each of the subclasses ...

3. Joined-subclass and entity-name cause Duplicate class/entity    forum.hibernate.org

Hello, I have a base Card class, that I have mapped using the "entity-name" tag, the goal being to be able to store the same entity differently depending on the context. The mapping is: Code: ...

4. Subclass not supporting ?    forum.hibernate.org

Hi If you have experience with the element you might be able to help me with a different problem in my other thread: https://forum.hibernate.org/viewtopic.php?f=1&t=1003443 I am using Hibernate core 3.3.2. Situation: I have a class with three subclasses mapped as single table inheritance. I am working on legacy data, so I can't change the schema. In the superclass I use ...

5. Delete subclass problem    forum.hibernate.org

Hi there, I write a program which contains "user" and "staff" class. And the "staff" class is subclass of "user". public class User extends BaseModel { protected boolean gender; protected String name; /* getter & setter */ } public class Staff extends User { /* Link to User class ("many-to-one" relationship) */ private User supervisor; private double salary; /* getter & ...

6. subclasses not working    forum.hibernate.org

Hi, First of all, I have subclasses with a discriminator working fine. When I load up a Person of type Employee it creates an Employee object for me, no problem[1]. My problem comes when I try to traverse a tree of these objects. I have a structure table, with person_id and person_parent_id. Starting with a Person (of whatever type) I can ...

7. criteria API query, filter multiple joined subclasses    forum.hibernate.org

Hi, I've an abstract class Content, which has a few subclasses extending from it: Video, Photo and Collection. Using the criteria API I found out how to query all Content instances (doesn't matter if it's a Video, Photo or Collection): Code: Criteria crit = this.getSession().createCriteria(Content.class); I also found out how to query for a specific content type, like querying only for ...

8. union-subclass mapping: help is needed    forum.hibernate.org

Hi, We have the following code that maps the abstract class Person and its two derived classes profile1 and profile2. as follows: ... now we have another class called Account that ...

9. union-subclass with discriminator -help required    forum.hibernate.org

Hi, I have a scenario as follows. Class A - No table (used to create id, and some common fields) Class B - Union subclass of class A Class C - Sub class of class B. Class B can have many sub classes. How do i specify a discriminator? This is what i tried. 1) Added the discriminator in Class A ...





11. Multi level hierarchy Joined subclass    forum.hibernate.org

Hi We are using Hibernate 2.x and trying the following using hbm xml mapping. We have a 3 level inheritance hierarchy and are using table per subclass. Class C extends Class B, Class B extends Class A. The table structure is: Table A has PK_A Table B has PK_B and a separate column PK_A (which obviously is a foreign key to ...

12. Multi level hierarchy using joined subclass    forum.hibernate.org

Newbie Joined: Sat Jun 05, 2010 2:21 pm Posts: 2 Hi We are using Hibernate 2.x with hbm xml mapping and trying the following: We have a 3 level inheritance hierarchy and are using table per subclass. Class C extends Class B, Class B extends Class A. The table structure is: Table A has PK_A Table B has PK_B and a ...

13. subclass entity-name and cascade    forum.hibernate.org

Hello, I have something like this: Code: ... ...

14. Union-Subclass and One to many relationship problem    forum.hibernate.org

org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com..entities.B1#1] at org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27) at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128) at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:177) at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87) at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862) at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:830) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266) at org.hibernate.type.EntityType.resolve(EntityType.java:303) at org.hibernate.type.EntityType.nullSafeGet(EntityType.java:217) at org.hibernate.persister.collection.AbstractCollectionPersister.readElement(AbstractCollectionPersister.java:644) ...

15. Hibernate 2: Subclass fields not working with Criteria    forum.hibernate.org

Hi All, I'm using the old Hibernate2(hibernate2.1.8) implementation. I'm using Single Table per Class design for my classes with the appropriate mapping and using Criteria API to generate queries using Example.create(). But the problem is the query that gets generated doesn't constrain the where clause with the fields from the subclass(which was supplied to the Example while creating a criterion. When ...

16. Help with discrimators and subclasses?    forum.hibernate.org

Hey, I'm pretty new to hibernate and just been playing around with it, I've had this working by just using the concrete StudentDetails class but then I tried to get it to work by creating an Interface class have having my concrete StudentDetails implement the StudentInterface class. I can't seem to get it to work now, I think it has something ...





17. HQL path for discriminator subclass property?    forum.hibernate.org

I have a discriminator class with two subclasses in their own tables. They don't share property/columns names as they store different information. If I had the two subclasses and one had a propery status, but the other didn't, can I add a WHERE clause for that property? With a mapping like this: Code:

18. join and joined-subclass    forum.hibernate.org

Am I correct in understanding that you cannot have a join and a joined-subclass element under one class element? If this is true how does one map this model where the join table defines a 1(subtype)-M(supertype) optional bidirectional relationship from the subtype to the supertype. The semantics of this relationship are independent of the supertype-subtype relationship. The subtype is one of ...

19. JPA Criteria Subclass Join Using Metamodel    forum.hibernate.org

I'm trying to create a criteria query on a class that has several different subclasses that have foreign keys to other classes. Value Subclass Table1Value extends Value => Table1 Subclass Table2Value extends Value => Table2 So I have Value which is referenced by some class and I want to be able to get to Table1 by way of subclass Table1Value, but ...

20. Subclass query loader    forum.hibernate.org

Newbie Joined: Thu Sep 02, 2010 5:02 am Posts: 1 Hi, this is my mapping: Code:

21. Multiple subclasses not using fetchmode join    forum.hibernate.org

Newbie Joined: Thu Sep 16, 2010 9:46 am Posts: 2 Hi, I'm having weird issues trying to use fetch="join" on the properties of more than one subclass of my hibernate mapping file. First, the situation: I have a constellation of one-to-many tables related by foreign key to a single parent table. The parent table defines the superclass, then overlapping subsets of ...

22. Criteria query for subclasses in collection    forum.hibernate.org

I'm trying to build a Criteria query, but I'm having some difficulty. In my system, a patient Case contains a Diagnostic, and each Diagnostic contains one or more MaladyDiagnostic. A MaladyDiagnostic can be any of several subclasses (let's call them MaladyDiagnosticA, MaladyDiagnosticB, and MaladyDiagnosticC, all of which extend MaladyDiagnostic). The gist of my query is that I want to find all ...

23. trouble with composites + subclass    forum.hibernate.org

I'm trying to create a set of tables that will handle a situation where I have been given a class "Event" with a corresponding table containing simple properties. I am extending Event with CompositeEvent which does 2 things: 1, contain several Events and 2, provide a little extra information. So essentially it should look like: Event [ ID, organizer ] -- ...

24. Issue:Mix table per class hierarchy with table per subclass    forum.hibernate.org

Newbie Joined: Mon Oct 04, 2010 5:37 pm Posts: 1 Hi All I have a very deep class hierarchy in my domain model and want to use discriminator tag to support inheritance. Initially i mapped my classes using join-subclass, however the tables involved have hundreds of thousands of records and it is turning out to be a performance bottleneck. So in ...

25. Table per hierarchy not identifying subclasses    forum.hibernate.org

I am mapping a table using "table-per-hierarchy". When I search by the ID, I am able to get one subclass(SubA) loaded correctly, but get a WrongClassException when trying to load a object which should be loaded to the 2nd subclass(SubB). Below is the hibernate mapping(having removed additional properties) and exception stack. Not sure if this matters but the mappings for individual ...

26. Querying according to subclass type    forum.hibernate.org

public List getByExample(Object o){ Session sessione=null; List risultato=null; try{ sessione=HibernateUtil.getSession(); risultato=(List)sessione.createCriteria(this.model) .add(Example.create(o)).list(); } ...

27. One-to-one association with a joined-subclass inheritance    forum.hibernate.org

Newbie Joined: Fri Nov 12, 2010 4:44 pm Posts: 1 Hello to everyone. I'm stucked on a Hibernate inheritance problem while working on a JSF-based. At first, I was oriented to use a interface implemented by two concrete classes but since mapping interfaces is not possible I used an abstract class extended by the two concrete classes. In terms of code: ...

28. search in multiple subclasses    forum.hibernate.org

i have the following classes @Entity @Inheritance(strategy = InheritanceType.JOINED) public class GenericContent {String columnA ...} @Entity public class AContent extends GenericContent {String columnB ...} @Entity public class BContent extends GenericContent {String columnB ...} @Entity public class CContent extends GenericContent { String columnC} i want to search in columnA for all the 3 classes. which is simpel criteria = getSessionFactory().getCurrentSession().createCriteria(GenericContent .class); disjunction.add(Restrictions.ilike("columnA", ...

29. subclassing with DiscriminatorValue and DiscriminatorFormula    forum.hibernate.org

I have a thread going on the redhat customer portal... but, I don't seem to be getting very far. Maybe someone here could give me a ya [or nay] on this. My thinking right now is this ISN'T possible. I have a class A. It maps to table X. I have another class B. It also maps to table X plus ...

30. Non Persistent Subclasses    forum.hibernate.org

I am prototyping so my data model is still unstable, as such I would like to separate the Hibernate base classes from added functionality by adding methods (but not data) to classes derived from my persistent Hibernate classes (and not to the base classes). Is there a nice way to set this up without tying a discriminator to a table? Best ...

31. UNIQUE key mapping in Joined Subclasses.    forum.hibernate.org

Hi guys, I am needing your assistance here, hope you can help me out. According to this post https://forum.hibernate.org/viewtopic.php?p=2370666, the way to specify two columns as a unique key (the combination of this 2 columns must be unique) is to apply this mapping: Code: ...

32. OneToOne mapping between superclass and subclass    forum.hibernate.org

Hi Napoleon, I think the reason you've not had any responses so far is that it's not very clear what you are trying to do. The problem has been abstracted so much that it doesn't really make sense: You're saying all entities of type A must be associated to a B. You're also saying that all Bs are As. Thus all ...

33. Modifying subclass in joined-subclass mapping    forum.hibernate.org

Hello, I was wondering if it's possible to modify the subclass of an object in a joined-subclass mapping and have hibernate delete records in the old subclass table and create new ones in the proper new subclass table. Currently this is not working for me and I'm wondering if there's a clean/standard way to handle this situation. Thanks in advance.

34. Mapping subclasses    forum.hibernate.org

I have class Data, which contains my data, and class DataArchive that merely extends Data and contains nothing new. The only other change in DataArchive is an xdoclet marking mapping it to table DATA_ARCHIVE rather than DATA. My generated hbm.xml files end up being exactly the same except for the class name and table mapping name. However, when I try to ...

35. union-subclass exception    forum.hibernate.org

I'm trying to change one of my model classes from a "class" type of object to a "union-subclass". I have two classes that map to two tables. Article Maps to Article and ObjectInfo maps to ObjectInfo. Article extends ObjectInfo (ObjectInfo is not abstract) and is referenced as a set in the Article class. Table Article has all the columns defined in ...

37. Mixing table per subclass and table per class hierarchy    forum.hibernate.org

Hi all, I have an existing model that was not designed to allow subclasses and only uses one kind of "abstract" class (let's call it B) for all types. That class inherits from A. I want to be able to make polymorphic queries to increase robustness (avoid to always use abstract types, and perform some server side controls based on class ...

39. Mapping different subclasses to different properties    forum.hibernate.org

Hi, I have the following table model: Expertise: ID Phase: ID, EXPERTISE_ID, DISCRIMINATOR Phase has 3 subclasses: FirstInstance, Appeal and Arbitration. An Expertise has each time one of each phase, where FirstInstance is always required and the other two are optional. So the idea is to have 3 properties in the expertise class: Code: public class Expertise { private ...

40. subclass of subclass    forum.hibernate.org

I have a 3 level heirarchy that is basically a Parent Class, a Child Class (which adds additional variables to the Parent), and a Grandchild (which is really more of a sibling, but the code extends from the Child...it is just a special version of the Child, does not add any variables). I created the parent class, and then used the ...

41. Property value class with subclass of subclass    forum.hibernate.org

42. Mixing Table per subclass and table per class hierarchy    forum.hibernate.org

@Table(name="A") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorValue(value = "A") public class A{} @DiscriminatorValue("B") @SecondaryTable(name="B", pkJoinColumns = { @PrimaryKeyJoinColumn(name = "aId", referencedColumnName = "aId") } ) public class B extends class A{ @Column(table="JobOffer") public String getTitle(){} } @DiscriminatorValue("BB") public class BB extends class B{} @Column public int getValue(){}

43. joined-subclass, changing between superclass and subclass?    forum.hibernate.org

We have a problem with the usage of joined-subclass when changing between the superclass and subclass for persistent entities. We use the following mapping: Code: ...

44. @OneToOne from subclass with shared PK - is this possible?    forum.hibernate.org

@Entity @org.hibernate.annotations.GenericGenerator(name="performer-primarykey", strategy="foreign", parameters={@org.hibernate.annotations.Parameter(name="property", value="performer") }) public class Portfolio implements Serializable { @Id @GeneratedValue(generator = "performer-primarykey") @Column(name = "portfolio_id") private Long id; @Column(length = 128) private String posterFileName; @OneToOne ...

45. How to query subclasses in Hibernate using Criteria or HQL?    forum.hibernate.org

I'm having some problems getting results for our payment code. Do I need a mapping from the subclass to the super? All I get from the query(listed below) is null for any of the values for Payment33DigitCode, yet can get values for PaymentSource such as the ID. Super: @Entity @GenericGenerator(name="sequence", strategy="sequence",parameters=@Parameter(name="sequence", value="S_PAYMENT_SOURCE_ID")) @Inheritance(strategy=InheritanceType.JOINED) @Table(name="PAYMENT_SOURCES") public abstract class PaymentSource implements PaymentSourceVisitable{ protected ...

46. subclass and _javassist_ classes    forum.hibernate.org

Author Message sharovse Post subject: subclass and _javassist_ classes Posted: Tue Aug 09, 2011 4:17 am Newbie Joined: Tue Aug 09, 2011 3:26 am Posts: 2 Hi. When loading objects (Link,Host,Socket,Program...), the heirs of the super class (CheckObject) in a single Hibernate session, _some_ of the objects instead of native class return class.simpleClassName = CheckObject_$$_javaassist_19. In this case no ...

47. StaleObjectStateException on reference to subclass    forum.hibernate.org

Newbie Joined: Sat Oct 08, 2011 4:59 am Posts: 2 Hi, I'm working on a small application to get to know hibernate. To the point I have implementet a domain model that looks like this: I used the table per class strategy and my Person.hbm.xml looks like this: Code: ...

48. Inheritance Joined Criteria Queryies to subclasses    forum.hibernate.org

Hi I have been trying to figure this out and cant. If I have the following class d Class ad extends d d has a reference to t as getT(); class T Class a extends T class p extends T How can I write a criteria query to go into a. I can do CriteriaBuilder cb = getEntityManager().getCriteriaBuilder(); CriteriaQuery query = ...

49. Can a subclass inherit a foreign key field?    forum.hibernate.org

I have an inheritance hierarchy in which the superclass abstracts out of the subclasses the foreign key relationships in a many-to-one mapping. The inheritance hierarchy is set up using a joined subclass arrangement, one table per subclass and one for the super class. EG: class A { String pKey; String CFKey; } // Table A class B extends class A { ...

50. Mapping Static subclasses with "One table per hierarchy    forum.hibernate.org

Hi All, I got a problem when tried to map a hierarchy using the "one table per hierarchy" strategy. I have an abstract superclass, named A, and 3 subclasses, B, C, and D. The problem is that I programmed B, C, and D, as private static classes of the superclass A. Something like this: public class A { int oid; String ...

51. Joined SubClass    forum.hibernate.org

Joined sub class allows polymorphic behaviour where the derived class properties are contained in an additional table rather then the one table hence the join is required. The relationship is determined from the key attribute, if the join was successful then the derived class will be instanciated instead of the base class. For example, ...

52. Why cannot i add record after using joined-subclass ?    forum.hibernate.org

The Device object can be persisted before.Now to meet the user's needs,we want to create a new class CompositeDevice which extends Device as below: package com.omnet.test; public class CompositeDevice extends Device { private Device _host; private int _slot; public int getSlot() { return _slot; } public void setSlot(int slot) { _slot = slot; } public Device getHost() { return _host; } ...

53. Invalid identifier on a Set of a joined subclass    forum.hibernate.org

I have a class (A) which has a set of a joined subclass (C). (C)'s parent is (B). (B) contains (A)'s primary key, but when I try to access the collection of (C) objects through (A), a select is generated which attempts to find (A)'s PK in (C) when it should find it in (B). Let me make up a real-world ...

54. joined subclass - stetement too long    forum.hibernate.org

Hello! We are evaluating hibernate to replace (as commonly done I guess :-) our home made O/R-Mapping. So we are bound to the object mapping strategy we are using. We are using a joined subclass model having an additional discriminator value in the top level table. To start with: Getting a first simple hibernate use up and running using one of ...

55. subclass inside joined-class element    forum.hibernate.org

Hi, This is a feature that I'm also interested in; specifically, putting "subclass" inside "joined-subclass". It seems that if you put the "discriminator" tag in a joined-subclass, and then put subclasses in, it seems to read fine -- but the whole thing dies at runtime (database constraint). It would seem logical to me that you should be able to put discriminators ...

56. join in the SQL when using 'joined-subclass'    forum.hibernate.org

hi, i have 2 related classes A and B mapped to different tables : '' uid_sequence '' class B extends class A. when i look for the object A using : ''session.createQuery("from A objet ...

57. is it possble: SELECT A1,A2,A3 FROM A, An is subclass of A    forum.hibernate.org

suppose A has three or more subclasses: A1, A2,A3... If I use "from A" I can get all its subclasses, but I wanna distingish those subclasses and display them in diff format in a report, I have no idea how. If I can use " select A1,A2... from A", then it'll be easy for me to understand and handle those subclasses ...

58. query a joined subclass using root class property in where..    forum.hibernate.org

hi there, I hope I did not oversee any FAQ or postings in asking the following: I have this relations: I want to query all Catalogs of customers in a specific zipcode area: select o from catalog as o where o.customer.address.zipcode = '12345' Here I get an SQL error 'unknown column name', because I get the following SQL (I cleaned it ...

59. dynamic joined-subclass    forum.hibernate.org

60. collection of subclasses - stumped    forum.hibernate.org

Hi All - I'm stumped on how to map a collection of subclasses in such a way that each collection of subclasses is initialized with only "subclass" type of entities. background: Our db schema, however bad, is such that: - we have Parent and Child entities - child entities are one of 3 "types", (think type=discriminator; 3 subclasses) - Parent has ...

61. how to let class2hbm generate joined-subclass    forum.hibernate.org

#1: You should NOT use class2hbm to generate "production quality" mappings! ....there are no way near enough information in a .class file to deduce this stuff ;) #2: class2hbm cannot generate joined-subclasses...do not think anyone have upgraded/used it seriously ;) ....so if you think you can make class2hbm better, then patches are welcome.......but rember #1

62. version tag and subclass    forum.hibernate.org

Consider this: Since Customer is a subclass of User... should I only have the version tag under User, or is the schema correct as is, with version tag under both the parent and the subclass?

63. class inheritance using joined-subclass    forum.hibernate.org

I am new to Hibernate. I am looking for best practice advices when deleting inheritance implemented by using joined-subclass (table per class). Description: Using table per class approach. An abstract base class, PERSON. A concrete sub-class, EMPLOYEE, of PERSON. Another concrete subclass, SALESPERSON, of EMPLOYEE. Both EMPLOYEE and SALESPERSON use joined-subclass in the mapping file. I understand an employee and a ...

64. Bug: tries to persist unmapped subclass property sometimes    forum.hibernate.org

Author Message rjbodkin Post subject: Bug: tries to persist unmapped subclass property sometimes Posted: Mon Nov 03, 2003 7:10 pm Newbie Joined: Mon Nov 03, 2003 1:46 pm Posts: 2 I have run into a case where Hibernate is trying to persist a property that is not mapped in the hbm.xml file. The example works if you rename the ...

65. Usage of proxy in Joined-SubClass    forum.hibernate.org

Hi, I got this class which is been inherited by two other class. The problem is whenever I query the parent class, the query is created as join on other two class also. How do I prevent it? would proxy solve the problem to this. I am usiing joined sub-class regards prasad chandrasekaran

66.  question    forum.hibernate.org

I have an hierarchy that consists of the following classes: - WebPage - ContentItem - News - Event - Poll WebPage has 1 or more ContentItem. News, Event and Poll are sub-classes of ContentItem. On my database structure I have the tables webpage, news, event and poll. News, event and poll have a foreign key of webpage. I thought about using ...

67. XDoclet ignore joined-subclass    forum.hibernate.org

Hi I seemed to have problem with Xdoctlet generate joined-subclass. It basically ignored my class here. Here is the class /** * @hibernate.joined-subclass * table="child2Table" * proxy = "testOR.IChild" * @hibernate.joined-subclass-key * column="sub_id" */ public class Child1Impl extends ChildImpl { .... Here is the ant I am using ...

68. Problem with subClass    forum.hibernate.org

I have a abstract class User with 2 subclasses Particulier and Entreprise define with the following mapping :

69. Access property of a subclass in HQL    forum.hibernate.org

70. joined-subclass is not working correctly    forum.hibernate.org

i have a 1:m relationship between two classes: the m part (hibernate bag) holds joined subclass elements. the foreign key (of the 1 part of this relation) is in the superclass-table. when i set the colletion (which has inverse="true") everything is updated EXCEPT the foreign key. when i use the inverse side everything is working. can someone help me with this? ...

71.     forum.hibernate.org

Hallo, i'm new to Hibernate. For a new project i evalueted some O/R mapping tools and it seems that hibernate is one of the best. The object model exists and my part is to persist it. Inheritance is used (1 base and 4 extended classes) and i need to map it as joined-subclasses with inverse="true" Searching the forum i found this ...

72. Change Subclass Type?    forum.hibernate.org

I have a simple hierarchy mapped as es: Parent - Child 1 -- Sub Child - Child 2 - Child 3 Is it possible to transform an instance of Child 1 into an instance of Sub Child? Or Child 1 -> Child 3? We have a product class hierarchy in which a user can switch between an inventory and non-inventory product ...

73. Why not Persist unmapped subclasses as parent class    forum.hibernate.org

If I map A but not SubA (a subclass of A), I cannot save SubA. I get a MappingException: No persister for SubA. Why can't Hibernate check class hierarchy to find the appropriate persister ? Is there a fundamental reason or an optimization tip ? I can't figure it out knowing that CGLIB will actually subclass A for proxying it.

74. Discriminator for would be nice    forum.hibernate.org

Is there a good way of improving performance for a large number of joined-subclasses? Our model is something like the following: Code: PropertyReport Appraisal extends PropertyReport Inspection extends PropertyReport ... about 10 more classes extend PropertyReport Each PropertyReport subclass has different attributes and is stored in a separate table (appraisal, inspection), with the parent class's attributes stored in a property_report table. ...

75. (xdoclet2) subclass / joined-subclass mapping    forum.hibernate.org

it would overcomplicate templates. And anyway, subclasses / joined subclasses CAN ( and WILL,. and already DO ; ) contain next level subclasses - and those subclasses go inside. So I prefer to keep a single behaviour.... ( you do not like templates which are difficult to debug, and this buggy? :) )

76. Mapping an interface hierarchy with subclasses    forum.hibernate.org

Hello... i have a problem on how to map the following simple example scenario. The Hibernate Reference tells me to use the -Tag to map implementig classes of interfaces. But I also need the -Tag to express the polymorphic structure, that is i. e. "Question" is extended by "NumericQuestion" Is the following mapping correct? Code: ...

77. (Xdoclet2) Subclass/Joines Subclass again    forum.hibernate.org

78. @hibernate.joined-subclass not working across packages    forum.hibernate.org

I you follow the link I gave to the XDoclet JIRA issue, you will find a work around. Not sure it is checked in our not (lots of the XDoclet Hibernate bugs have been lingering in an "Open" status). If it hasn't been, just download the source for XDoclet, make the recommended change and rebuild the Hibernate module. Good luck. Ryan ...

79. Subclassing and "net.sf.hibernate.MappingException"    forum.hibernate.org

Please help!!! First, I am using Hibernate 2.0.3 and Spring. I have a interface called PaymentType which has 2 implementing classes- CreditCardPaymentType and EmailPaymentType. I am able to persist new PaymentTypes without issues; however, when associating a PaymentType to another object (Registration), I receive the following exception: No persister for: com.demandsolutions.merovingian.payment.entity.PaymentType; nested exception is: net.sf.hibernate.MappingException: No persister for: com.demandsolutions.merovingian.payment.entity.PaymentType Registration.java ------------------------ ...

80. IllegalArgumentException with joined subclasses in 2.1 final    forum.hibernate.org

Hi, I have created a structure like: User extends Actor, Group Extends User. Actors can have Permissions (See below the hbm.xml). While adding a permission to a user or group I get the IllegalArgumentException during commit(). In BasicPropertyAccessor.java[96] I can see, that Hibernate tries to execute getId() on the target Permission but methods contains the clazz Actor?! In 2.0.2 this code ...

81. mixing and     forum.hibernate.org

I'm implementing generation of inherited classes in the AndroMDA Hibernate cartridge. I've chosen the strategy for the table mapping because tool users. Things are almost working, but unfortunately have run into a limitation with Hibernate. The DTD defines a class mapping as: Code:

82. Strange Subclassing Question    forum.hibernate.org

Hello, I'm using the "table per class hierarchy" strategy. I have a strange question about inherited properties. It's a long explanation as to WHY I want to do this, but the question itself is straightforward: Can I override ride a property in a subclass's mapping with a DIFFERENT column name than it's superclass? For example: [class:Animal] [subclass:Dog]

83. Error on table-per-subclass, need help    forum.hibernate.org

Exception: net.sf.hibernate.WrongClassException: Object with id: 60388287-8fe7-4b11-b820-3d728e8d8466 was not of the specified subclass: gov.gdgs.enterprise.Enterprise (Discriminator: 1100 ) enterprise.hbm.xml:

84. Using and     forum.hibernate.org

Hi, Im having a problem with using and . I have a base class Question (mapped onto table: Question) from which 2 classes extend namely, EssayQuestion and MCQ. I have mapped MCQ onto the same table: Question. Thus I have used for MCQ mapping. For this I have specified a discriminator column in Question table and discriminator values in ...

85. joined-subclass error    forum.hibernate.org

Hello, I'm attempting to do a joined-suclass and I get the following error: 10:18:30,354 WARN [JDBCExceptionReporter] SQL Error: 923, SQLState: 42000 10:18:30,354 ERROR [JDBCExceptionReporter] ORA-00923: FROM keyword not found where expected Here are snippets (whole hbm is too long) from my hbm: Code:

86. enforcing mandatory properties in a subclass    forum.hibernate.org

I have a class A and subclass B. B has a mandatory (ie not null) attribute P. Options I know of for modeling and enforcing the mandatory attribute in hiberate are: 1. Use joined-subclass, and set not-null="true" attribute of or elements (enforced by DB). 2. Use subclass, set not-null="false" and use an interceptor to validate the mandatory requirement of ...

87. replicate() with joined-subclass    forum.hibernate.org

I'm trying to call Session.replicate() with persistent objects mapped with joined-subclass and I'm getting a JDBCException. Code: net.sf.hibernate.JDBCException: could not retrieve version: [com.foo.bar.data.synch.Synch#com.foo.bar.data.sites.CompositeSiteID@1d97d0d[sequenceId=965,site=com.bpsphone.mpression.data.sites.Site@39d811[id=3]]] at net.sf.hibernate.persister.AbstractEntityPersister.getCurrentVersion(AbstractEntityPersister.java:1141) at net.sf.hibernate.impl.SessionImpl.replicate(SessionImpl.java:3698) at.... Here's the offending SQL: Code: select version from synch.synch ...

88. subclass problem    forum.hibernate.org

Hi all I am new to this hibernate, pls bear with me if question of similar nature has been answer b4. Supposing I have a BRAND table with following attributes -------------------- CODE : Non unique 3 letter code TYPE : e.g. drink, car NAME : Pepsi, Coke, Toyota, Nissan composite key (CODE, TYPE) -------------------- I am further defining a separate Car ...

90. referencing primary key in inherited subclass    forum.hibernate.org

What do you mean by "getter / setter broken". The getters and setter are correct, ve already check them. I need the primary key for using it in the following sentence: losSuplementos = GuiSGP.session.find("from Suplemento where F_IdProducto ="+ idProducto + " and A_Habilitado =" + 1 + " and A_BajaLogica =" + 0); Where id producto is the primary key ,Does ...

91. one-to-one with subclass    forum.hibernate.org

92. How to define many-to-many in a subclass?    forum.hibernate.org

93.  and .class in HQL lead to incorrect    forum.hibernate.org

Author Message SergeBeaumont Post subject: and .class in HQL lead to incorrect Posted: Fri Jan 23, 2004 7:27 am Beginner Joined: Wed Nov 26, 2003 11:53 am Posts: 26 Location: Netherlands Hello, I have a case where using .class in a HQL query leads to incorrect SQL. I could be using the .class in an incorrect way, but ...

94. querying on properties of a joined-subclass    forum.hibernate.org

I have a class BioSequence has a joined-subclass called Contig. I have a class Feature that has a property 'sequence' of type BioSequence. 1) I would like to do a query on a Feature and include properties of Contig in the where clause. Right now I am doing it like this: from Feature f, Contig c where f.sequence.id=c.id and c.number>4 Is ...

95. Joined-Subclass on other XML file    forum.hibernate.org

Hi! I have the following problem: There is a project with some persistent classes (and their XXX.hbm.xml descriptors), wich are used by various other projects. That main project has a class (ie, Person) wich is general. One of the other projects has a specific class (ie, Customer), that does not belong to that general project. I cannot map the joined-subclass on ...

96. Hibernate query for subclass in association    forum.hibernate.org

Hello, I have a question on how to create a query in Hibernate that properly resolves a subclass. Lets say I have 4 classes: A, B, B2 and C with the following relationships: B2 is a subclass of B. A has a many-to-one association to a B B2 has a one-to-one association to a C I need to create a query ...

98. replicate() with joined-subclass still faulty    forum.hibernate.org

Newbie Joined: Thu Sep 04, 2003 3:36 am Posts: 11 Location: Karlsruhe/Germany Hi, it seems like the bug described in http://forum.hibernate.org/viewtopic.php?t=926835 still hasn't been fixed completely. Referring to HB-609 we've tried the latest CVS snapshot (20040129) and got: Code: 2004-01-29 14:18:22,610 [RMI TCP Connection(4)-172.21.1.183] DEBUG - Getting version: [com.company.product.app.vo.ImmobilieVO#2c958134fa61a0e200fa61a253da0028] 2004-01-29 14:18:22,610 [RMI TCP Connection(4)-172.21.1.183] DEBUG - about to open: 0 open ...

99. Pls hlp w/custom persister mapping in joined-subclass...    forum.hibernate.org

MY ERROR: net.sf.hibernate.MappingException: Error reading resource: . . . Caused by: net.sf.hibernate.MappingException: invalid mapping . . . Caused by: org.xml.sax.SAXParseException: Attribute "persister" must be declared for element type "joined-subclass". MY MAPPING (Part of it--all that's relative I hope): I'm not sure what's up...it seems that "persister" is an attribute for joined-subclass according to the DTD. ...

100. Collection of joined-subclass HQL question.    forum.hibernate.org