subclass 8 « Map « JPA Q&A





1. Exception while storing table per subclass hirearchy to DB    forum.hibernate.org

Author Message tex321 Post subject: Exception while storing table per subclass hirearchy to DB Posted: Tue Jan 15, 2008 6:33 pm Newbie Joined: Fri Oct 05, 2007 7:34 am Posts: 4 Hello. I haven't found answer to my question anywhere so this my last resort. I must fix problem until next release (later this week) so I would really ...

3. Table Per Subclass performance concerns for large hierarchy    forum.hibernate.org

Hi, We have a problem with our use of Hibernate; I don't think it's version or platform specific, but more likely our modeling and mapping that requires fixing. Hibernate version: 3.1.3 Oracle 10g and MySQL 5.1 HQL Code: from WarehouseItemDTO item where item.workspace=:workspaceName and (exists (from WarehouseContentItemDTO ci where ci.id = item.id and ci.nodeId = :id) or exists (from WarehouseCampaignDTO cp ...

4. Using natural-id inside subclass    forum.hibernate.org

5. Table subclass + view field with view field    forum.hibernate.org

Hi all, this is my first post so please be kind if I'm not clear. Here is my problem I have two tables: 1) Journey 2) Orders That I have mapped correctly. Question 1: I want to map Journey subclass (call this subJour) with only a subset of Journey fields how to do this???(and before saying it's really easy read the ...

6. subclass/inheritance not working with annotations but xml ok    forum.hibernate.org

Newbie Joined: Wed Feb 13, 2008 6:01 am Posts: 8 Hi I am having trouble mapping the single table inheritance with annotations. I have pasted the code below and it shows the version with annotations and the xml mapping file. For the test I am explicitly using an AnnotationConfiguration() and a classic Configuration() so I can exercise the mapping and the ...

7. Table per subclass    forum.hibernate.org

Hi, I am having difficulties with inheritance in hibernate. I have two classes mapped on a table per subclass hierarchy. The two classes are BillingDetails and CreditCard with CreditCard inheriting from BillingDetails. The problem is the following: I have saved an object of type BillingDetails, then I copy its properties to a CreditCard object and when I try to save and ...

8. Possible to use parent class mapping for all the subclasses?    forum.hibernate.org

My classes: class A { long id; String abc; } class B extends A { } My mapping: Is it possible when I in my DAO when I call getHibernateTemplate().save(new B()); ...

9. "Casting" an object to one of its subclass    forum.hibernate.org

Hello, What I have in my application is a class, say Account, and a subclassed class AdminAccount. Sometimes I need to promote an Account to an AdminAccount. So I wanted to know if there is an idiomatic or good practice way to achieve that in Hibernate. The only solution I have found so far is to delete the old object and ...





10. Discriminator: access to subclass    forum.hibernate.org

Author Message Thagan Post subject: Discriminator: access to subclass Posted: Fri Mar 14, 2008 8:01 am Newbie Joined: Fri Mar 14, 2008 6:59 am Posts: 6 Hi I'm using Hibernate version:3.2.5 and I'm using the discriminator tag in hbm.xml file to specify some object's properties. This is my hbm: Code: ...

11. Discriminator: access to subclass    forum.hibernate.org

Author Message Thagan Post subject: Discriminator: access to subclass Posted: Fri Mar 14, 2008 8:02 am Newbie Joined: Fri Mar 14, 2008 6:59 am Posts: 6 Hi I'm using Hibernate version:3.2.5 and I'm using the discriminator tag in hbm.xml file to specify some object's properties. This is my hbm: Code: ...

12. Discriminator: access to subclass    forum.hibernate.org

Author Message Thagan Post subject: Discriminator: access to subclass Posted: Fri Mar 14, 2008 8:02 am Newbie Joined: Fri Mar 14, 2008 6:59 am Posts: 6 Hi I'm using Hibernate version:3.2.5 and I'm using the discriminator tag in hbm.xml file to specify some object's properties. This is my hbm: Code: ...

13. Discriminator: access to subclass    forum.hibernate.org

Author Message Thagan Post subject: Discriminator: access to subclass Posted: Fri Mar 14, 2008 8:06 am Newbie Joined: Fri Mar 14, 2008 6:59 am Posts: 6 Hi I'm using Hibernate version:3.2.5 and I'm using the discriminator tag in hbm.xml file to specify some object's properties. This is my hbm: Code: ...

14. Hql query for table per subclass with discriminator    forum.hibernate.org

Hello, I am using hibernate 3.2.6.ga and and Mysql 5.0.15. I have an Answer pojo mapped like this: Code: ...

15. subclass which has seperate table mapping should not be quer    forum.hibernate.org

I have the following mapping Resort.class is an Interface mapped to resort table FamilyResort.class and BusinessResort implement the above interface and mapped by subclass within the Resort mapping. I have another concrete class EuropeanResort implementing the above Resort interface but mapped to a seperate table called eu_resort in a seperate class tag. When I query using Resort interface, hibernate is querying ...

16. Duplicate ids in subclass table mappings    forum.hibernate.org

Newbie Joined: Sat Mar 22, 2008 10:11 am Posts: 1 I have a problem using the subclass-per-table mapping. I'll show the mapping/tables first (which seems to me to be the correct thing to do...) But before that, quick statement of problem: I have two subclassed tables, childOne and childTwo. The parent object contains collections of childOne and childTwo. In some cases, ...





17. Remove Discriminator Check when mapping a subclass?    forum.hibernate.org

Hibernate version:3.2 Hi, I am using an TablePerHierarchy strategy. I'm using a userType as a discriminator and it is working quite fine. I use a discriminator Formula which I send to the userType discriminator who gives the right class Name to hibernate. My Problem occurs when I need to map a sub class. Let say we have the following hierarchy: Code: ...

18. a joined-subclass problem,help plz.    forum.hibernate.org

Newbie Joined: Thu Oct 14, 2004 10:36 pm Posts: 5 Hello all. I am using hibernate 3.2.4 sp1,mysql5.0,jdk1.6,and mysql-connector-java-5.0.7. When has not increased the joined-subclass fragment, this method can worked fine,after adding joined-subclass, presents the following mistake(Below is the tomcat console output message). Hibernate: select * from metadata as m where m.sort_id=? and m.city_id IN (select m2.city_id from metadata m2 where ...

20. could't map subclass with tag subclass    forum.hibernate.org

I map it with joined-subclass first and everything is ok. But when i try to map it with subclass tag i got the Exception. Tks for any help. 3.1

21. problem with subclass mapping    forum.hibernate.org

Newbie Joined: Fri Apr 04, 2008 4:13 am Posts: 5 Sorry to post it again, but it's really a emergency problem need to solve. I map it with joined-subclass first and everything is ok. But when i try to map it with subclass tag i got the Exception. Tks for any help. 3.1

22. Problem refreshing with subclass    forum.hibernate.org

Hibernate version: 3.1.2 I have an object with an one-to-one association. This one-to-one object have several subclasses using a discriminator value. Some of the subclasses have join table. When I do a refresh of the first object, I got a ClassCastException because, for some reason, Hibernate tries to set a value from the subclassed object to the one-to-one. I got the ...

23. subclass obj references unsaved transient instance of base    forum.hibernate.org

Hi, I have a problem with 2 entities - a subclass (Person) that has a base class (SystemUser) with the JOINED Inheritance strategy. I am using: JBoss 4.2.2 GA, Hibernate version: 3.2.4 sp1, Hibernate EntityManager 3.2.1 GA The Code: Here is the code for each class: Code: @Entity @Inheritance(strategy=InheritanceType.JOINED) public class SystemUser implements Serializable { private static ...

24. ON DELETE CASCADE between subclass and superclass?    forum.hibernate.org

Hibernate version: 3.2.6 Name and version of the database you are using: MySQL 5.0 Hi, I have a simple data model that looks like this: Container --> 1:N --> AbstractChild AbstractChild uses the JOINED SUB CLASS strategy. AbstractChild is the superclass of Child1, Child1 is the superclass of Child2, and so on. I looked at the DDL generated for this model, ...

25. Subclass mapping problem    forum.hibernate.org

Hi, I am trying to map subclass, but I am not sure if it should inherit my class or my generated class. This is how my xml looks like: com.bsc.ngpt.domain.base.UserBase ...

26. Subclass mapping problem    forum.hibernate.org

Newbie Joined: Fri May 09, 2008 5:56 am Posts: 4 Hi, I am trying to map subclass, but I am not sure if it should inherit my class or my generated class. This is how my xml looks like: Code:

31. How to write custom HQL for joined-subclasses?    forum.hibernate.org

Author Message saadnabs Post subject: How to write custom HQL for joined-subclasses? Posted: Wed Jun 04, 2008 8:16 pm Newbie Joined: Wed Jun 04, 2008 8:03 pm Posts: 1 Location: United Kingdom Hello, I've been trying to figure this out, so any help would be much appreciated... I've got a World Item: Code:

32. Versioning of joined-subclasses    forum.hibernate.org

I have two tables that were originally mapped as a one-to-one relationship, but subsequently re-mapped using Hibernate's inheritance capabilities. Here's the quirk: as these tables were originally mapped as a one-to-one relationship, each table has a version number (mapped using Hibernates tag). When I re-did the mapping as a joined-subclass, I noticed that Hibernate does not support the version tag ...

34. Versioning in a subclass    forum.hibernate.org

Is there any way to apply versioning concepts to a subclass. We have 3rd party application that uses hibernate which I can extend from but cannot modify (mapping files are hidden away in a jar file). In order to extend I've created the below mapping file: Code:

35. A superclass-subclass mapping question    forum.hibernate.org

36. subclass -> join -> set -> erreur !!!    forum.hibernate.org

...

37. subclasses with same discriminator-value    forum.hibernate.org

hi! searched the web but didn't find anything that could help me. here's the story (see xml on bottom): i get many objects (for instance MegaSpeise) through a webservice, but the functionality is not enough so i have to extend these objects to gain my new objects (f.i. SpecialSpeise). because i do not want to map all these files to my ...

38. Subclass - how to lazy init byte[] field    forum.hibernate.org

Hi I have a class: A{ string name; byte[] document; } and I want to load A with lazy "document" property. As far as I know, lazy attribute is permitted only in case of collections, so I decided to extend class A.. B: A{ } now.. how to map it? A mapping shouldn't have document property... B mapping should have it... ...

39. Compound key, joined subclasses, error: no logical column    forum.hibernate.org

@Entity @Inheritance(strategy=InheritanceType.JOINED) @IdClass(ExoticKey.class) @Table(name="CONFIGURABLE_OBJECT_VW") @DiscriminatorColumn(name="DISCRIMINATOR") public abstract class PropertyTarget { @Id @Column(name="CLIENT_ID") private Long clientId; @Id @Column(name="SKILL_ID") private Long skillId; // this is for convenience... public ExoticKey getId() { ...

40. Joined-subclass problem with changing type parent2child PLS    forum.hibernate.org

Hi, I have a class A and class B B : A A has normall class mapping B has joined-sublcass mapping.. Everything goes OK - I can create A, create B, update A, update B ... The urgent problem is when I load A and I create B basing on it for example making B something = (B)A; When I want ...

41. Table per subclass with table per class hierarchy    forum.hibernate.org

Newbie Joined: Fri Jun 30, 2006 12:11 am Posts: 4 Location: Pune Hi, I am facing an issue with mixed inheritance. Table per subclass with table per class hierarchy is being used. Code: ...

42. Serious error with mapped subclasses    forum.hibernate.org

I have an interesting mapping case that is causing me some very odd low-level errors. In this particular case, I'm working with a table that contains multiple objects and I can use a DiscriminatorColumn to differentiate. To do this, I created a base class, gave it the DiscriminatorColumn annotation, and then extended it with my various types. I do this simply ...

43. HQL Update doesn't work when updating subclass column    forum.hibernate.org

Hibernate version: 3.2.4sp1 Mapping documents: Mixing table per class hierarchy with table per subclass Note: I have changed the class names, table names and column names from the original scenario. Code: ...

44. Both implementing interface and subclassing a class    forum.hibernate.org

I have an folloving problem: I have two classes Father and Son, that extends Father. I also have an interface Interface, that is implemented by the Son. Some getters and setters in the Father and Son manipulate with the Interface (they are typed to the Interface, but the object are instances of Son of course). I have created an xml description ...

45.  generates huge sql query    forum.hibernate.org

Author Message dotteben Post subject: generates huge sql query Posted: Wed Sep 03, 2008 6:07 pm Newbie Joined: Wed Sep 03, 2008 5:58 pm Posts: 4 Hi, I have an inheritance hierarchy mapped in Hibernate using union-subclass and I have noticed that the generated sql queries for any one of the subclasses ends up including absolutely everything from ...

46. Table per class hierarchy with undeclared subclasses?    forum.hibernate.org

Hi! I've been trying to do the following, without success until now, and I am wondering whether that is possible at all. Here is my idea: I want to develop a library, let's say to manage a zoo :o) In that library, I have a class called Animal that can be persisted with hibernate: @Entity public class Animal { @Id String ...

47. Subclass mapping problem    forum.hibernate.org

Hi, I am facing subclass integration issue. Plz guide me. My hmb.xml mapping

48. Alternative to table per subclass using a discriminator    forum.hibernate.org

When using the table per subclass using a discriminator inheritance mapping, I could not figure out how to tell Hibernate to lazy load the subclass, despite having "polymorphism=explicit" on the class mapping and "lazy=true" on both class and subclass mappings. All of this and wanting for Hibernate to return the correct subclass of course. Hence, I am now opting for a ...

49. How to implement Second level caching for joined-subclasses?    forum.hibernate.org

Hi, We have an hierarchy of entities: Parent => A,B,C Class A is potentially very large and dynamic population. Caching it would be very memory consuming and un-efficient. On the other hand, B and C are really good candidates for caching as they are rarely modified and are recently read. The mappings of A,B,C are defined as joined-subclasses of Parent. How ...

50. register a custom type without subclassing the dialect?    forum.hibernate.org

We use a couple of cutom UserType objects in our system. At the moment, we register them globally with Hibernate by subclassing a particular Dialect (say, OracleDialect, for example) and then calling the registerColumnType(int code, String name) method during construction. But, now we want to make our app run on two different databases. Is there any way to register our custom ...

51. insert only subclass row in a table per subclass stategy    forum.hibernate.org

I have a superclass that models an existing table called person that already contains data. There is also a subclass Employee. Now I want to be able to convert an existing person to an employee. When saving an employee, Hibernate should check to see if there is a row in both the person and the employee table and then do a ...

53. SOLVED !!Joined Subclass    forum.hibernate.org

Hi, i am trying to use in inheritance mapping. So, i have a Super Class Artikel and one child class FremdArtikel. Furthermore i have a link from FremdArtikel to Artikel. So, how can i do that? My Mapping looks like that: Code: ...

54. Inheritance declared subclasses    forum.hibernate.org

Hi all, I have a structure as follow: class A is my superclass and class B extends A. I'm using InheritanceType.SINGLE_TABLE strategy for mapping this inheritance, so need I declare class B in my hibernate.cfg.xml configuration file too? I declared the supreclass in my config file, but when i put the B class in it, an exception was thrown. Thanks in ...

55. Joined-subclass useability margins    forum.hibernate.org

In our legacy system we have 4 level hierarchy of objects with dozen of entities. In root entity we generate id and use hierarchically organized integer discriminator. Application level based on Oracle editable view with instead-of triggers. The question is how applicable joined subclass approach without discriminator for our data. I think joining altogether underlying tables as in your Animal example ...

56. map interface with only 1 subclass?    forum.hibernate.org

57. Table per subclass SQL question    forum.hibernate.org

jboss-seam-2.1.0.SP1 Hibernate version:3.3.2 Project is generated with seam-gen. Following setup works fine but I am confused with the generated SQL. I have the following tables. ------------------------------- User Patient Doctor Supervisor Respective hibernate objects --------------------------------- @Entity @Table(name = "user") @Inheritance(strategy = InheritanceType.JOINED) User @Entity @Table(name = "patient") Patient extends User // id is not defined here. @Entity @Table(name = "doctor") Doctor extends ...

58. How to join subclass of the association class    forum.hibernate.org

Hi there, I have Cat, Dog, Tiger entities, and Animal entity as base class. Mapping to this is "table per subclass". Also, Person class has many Animals, using "bag" xml-element (bidirectional relation). Each Cat and Tiger has property as ClawSize. But this property (assuming it is not significant to Dog nor Animal) will NOT belong to Animal nor Dog. I want ...

59. Bug in subclass mapping using joins with fetch="select&    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.3.1-GA Mapping documents:

60. Inheritance mapping - Table per subclass    forum.hibernate.org

Hi, I want to map a simple class hierarchy that consists of two classes at the moment: Person and Lodger. Lodger is inherited from Person. I want to use table per subclass with mapping files. Do I need a own mapping file for the class Lodger? My mapping file for Person looks like this: Code:

61. Joined Subclass with multiple levels generates wrong SQL    forum.hibernate.org

Hello, While doing a refactoring where we changed the inheritence strategy we discovered that the generated SQL does not return the same results as before (unit test). The mapping: Code: ...

63. Can't save object of mapping with     forum.hibernate.org

64. Table per subclass / Multi-level Hierarchy    forum.hibernate.org

Hello, I have some issues with multi-level hierarchy mapping using the "Table per subclass" strategy. Here is the list of the db tables I am trying to map using the "Table per Subclass" strategy: 4 Tables: USER (Abstract Superclass) EMPLOYEE (USER Subclass) CUSTOMER (USER Subclass) MANAGER (EMPLOYEE Subclass) Following the principles of ERM, I should have this approach since I will ...

65. Error deleting tables with joined-subclass reference    forum.hibernate.org

Hello, I have a problem using Hibernate with NetBeans 6.5; I have three tables table1, table2, table3; table2 and table3 are defined joined-subcalss of table1 in mapping file of table1; when I try to cancel table1 Hibernate should cancel before table2 and table3 but when try to cancel table2 for example I have verified that Hibernate try to cancel immediatly table1, ...

66. subclass instance mismatch in table-per-subclass??    forum.hibernate.org

Newbie Joined: Fri Feb 08, 2008 2:41 pm Posts: 18 It seems that Hibernate is unable to load two objects with the same base class (using the table per subclass strategy) at once. I have the following structure: Code: @Entity @Table(name = "person") @Inheritance(strategy = InheritanceType.JOINED) public class Person implements Serializable { private String id; ...

67. HQL query for OUTER JOIN between superclass and subclass ?    forum.hibernate.org

Hi, I need to write a HQL query. The HQL query mainly contains OUTER JOIN between superclass and subclass. Because we want to get property belonging to both superclass as well subclass. The superclass and subclass relation have been implemented as "table per hierarchy". The relationship between objects are something like this: Object1 => a separate class/table

68. Transient methods in superclass in Joined subclass strategy    forum.hibernate.org

We are using Joined subclass strategy using @Inheritance(strategy=InheritanceType.JOINED) as below. @entity @Inheritance(strategy=InheritanceType.JOINED) class A { //some general properties private String detail; @transient public String getDetail() { return detail; } @transient public void setDetail(String detail) { this.detail = detail; } } @entity class B extends A { //some specific properties @Column(name = "Detail") public String getDetail() { super.getdetail(); } public void setDetail(String ...

69. Question on union-subclass combined with DOM4J output - bug?    forum.hibernate.org

Newbie Joined: Thu Nov 20, 2008 10:24 am Posts: 2 Hi there, I'm going through the Java Persistence with Hibernate book. I know there is a forum for that, but IMO this is more to do with general hibernate usage. Please note this is not a critical issue for me: rather I am just curious to know if this is a ...

70. Map one table per concrete class with union-subclass    forum.hibernate.org

Hi, I'm trying to solve such a problem: 2 tables, 3 classes (one abstract, 2 concrete classes). Like form documentation example:

71. subclass with a map    forum.hibernate.org

Newbie Joined: Tue Aug 21, 2007 10:35 am Posts: 6 Hello I'm trying to use subclasses and a map (see the bold part of mapping), but it gives an error validating the XML (The content of element type "join" must match "(subselect?,comment?,key,(property|many-to-one|component| dynamic-component|any)*,sql-insert?,sql-update?,sql-delete?)".) And gives the follow exception, I know the XML is invalid, but I wanna know the right way ...

72. Inheritance mapping for a subclass that has an additional PK    forum.hibernate.org

I have this abstract Answer class that has subclasses like AnswerDate,AnswerNumber and AnswerOption depending on the type of the answers. The Answer class has an id (QuestionnaireId, QuestionId) All tables except for AnswerOption can be uniquely identified by this id. AnswerOption needs a primary key of (QuestionnaireId, QuestionId, OptionId) as there could multiple options selected as an Answer. I am having ...

73. joined-subclass error    forum.hibernate.org

Hello, I'm attempting to do a joined-suclass and I get the following error: ERROR: relation "software" does not exist generated sql is - select this_.id as id0_, this_.name as name0_0_, this_.description as descript3_0_0_, this_.price as price0_0_, this_.supplierId as supplierId0_0_, this_1_.version as version1_0_, case when this_1_.productId is not null then 1 when this_.id is not null then 0 end as clazz_0_ from ...

74. Object with id: 1 was not of the specified subclass    forum.hibernate.org

Beginner Joined: Mon May 26, 2008 3:34 am Posts: 31 Hello everyone, I am getting an error while getting several lists of categories. This si my Category.java (UserCategory, ArticleCategory, ResourceCategory and ProfileCategory extends from it): Code: /** Serial version ID. */ private static final long serialVersionUID = -9093525414764126719L; ...

75. joined-subclass saving supercalss data    forum.hibernate.org

...

76. how to use discriminator right? table per subclass hierarchy    forum.hibernate.org

How to use a discrimator right? I have a stranger problem with using discriminators. I was reading that you have to additionaly set the where-clause to the right type (discriminator value). The problem is here that many-to-one does not provide the where-clause!!! I was searching on the internet and was reading this article: http://jroller.com/eyallupu/entry/getti ... en_mapping Setting Forcing on true did ...

77. Please help with this Subclass problem    forum.hibernate.org

Author Message mystic Post subject: Please help with this Subclass problem Posted: Wed May 13, 2009 12:16 am Regular Joined: Tue May 12, 2009 6:08 am Posts: 92 Hi everyone. I'm trying to delete a row out of a table that has 3 sub-classes. It's just mapped to 1 table to keep it simple. However, I'm getting a weird ...

78. One-to-one mapping does not work for joined subclass    forum.hibernate.org

Hi I have two tables; Person and Address (a Person has only one Address and it owns it; Address does not know about Person). Person and Address share the same primary key. When I map Person and Address as follows: Code: ...

79. Inheritance Mapping "Table per subclass "    forum.hibernate.org

Hi, Sorry for my poor english its not my main langage I need the type of mapping inheritance "Table per subclass" like in Chapter 9.1.2 creating a table for the superclass and a table per subclass . My problem is that when the table of the superclass already contains a record (because of datas prior to mapping inheritance) and I try ...

80. Can filters works only on subclasses?    forum.hibernate.org

81. select for each subclass for table per class hierarchy    forum.hibernate.org

@Entity @Table(name = "transaction") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn( name = "type", discriminatorType = DiscriminatorType.STRING ) public abstract class Transaction @Entity @DiscriminatorValue("A") public class TransactionA extends Transaction @Entity @DiscriminatorValue("B") public class TransactionB extends Transaction public abstract class TransactionD extends ...

82. Defining temporal filtering with table per subclass strategy    forum.hibernate.org

Hi I want to define some temporal filters so that I can retrieve the state of my data at a point in time. With a parent object and child collection objects, this seems to mean defining a many-to-many mapping (instead of one-to-many) to describe the relationship. Then presumably I can create a new parent record every time the parent is updated ...

83. Hibernate Generating query for Subclass table    forum.hibernate.org

Hi, I have created mapping files for the below two files. For the sake of simplicity, assume the table names and column names match their Java counterparts class Prod{ Long id; Long wid; //In mapping file prmary key is id //Getters and Setters generated } class Stage extends Prod{ //In mapping file composite key is (id, wid) //Empty class } Here ...

85. Problem with joined subclass    forum.hibernate.org

Hi everyOne, I have googled for some hours without findig any answer if someone could point me in the right direction will be appreciated. I have the following: Code: @Entity @Table(name = "persona", catalog = "sime") @Inheritance(strategy=InheritanceType.JOINED) @SuppressWarnings("serial") public class Persona implements Serializable { /** * ...

86. joined-subclass and StaleObjectStateException    forum.hibernate.org

Hello, I'm trying to save an object of this class: Code: public class Profesor extends Persona { private Dedicacion dedicacion; private UnidadOrganizacional unidadOrganizacional; private Date fechaIngreso; .... } This is the class it extends: Code: public class Persona extends Entidad { private TipoDocumento tipoDocumento; private String ...

87. Why the subclass also is fetched when querying on its super    forum.hibernate.org

Urmech wrote: Hi, without the GroupInfo class, I can't tell you. But keep in mind that one2one and Many2one relations are fetched eager by default. If you don't want this behaviour, just force lazy. (E.g. with Code: @Basic(fetch = FetchType.LAZY) ) You can eliminate multiple results with: Code: q.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); Greetings Michael Thanks for your input. I, however, am unsure it is ...

88. Single table inheritance with subclass @ManyToMany mapping    forum.hibernate.org

I have an application which persists report parameters. Reports are mapped through a single table hierarchy (a wide table, but with relatively few rows). Problems arise when the same @ManyToMany mapping is used in multiple report subclasses. In this cases Hibernate schema export will generate multiple constraints for the same foreign key. This results in an error on Oracle, not allowing ...

89. Subclass with dynamic-Map entity mode    forum.hibernate.org

90. how to update an object from one subclass to another ?    forum.hibernate.org

Hi, I'm using Hibernate 3.2.5 and Hibernate Annotations 3.3.0. I have a problem with a class hierarchy defined with annotations using InheritanceType.JOINED . I have a bunch of common attributes in the parent abstract class (in T_RESOURCE table), and specific attributes in subclass tables (T_SQLQUERY_RESOURCE and T_FILE_RESOURCE for example). Code: @Entity(name="T_RESOURCE") @Inheritance(strategy = InheritanceType.JOINED) public abstract class AbstractLogLinesResource implements Cloneable { ...

91. Joined SubClass with a different identities.    forum.hibernate.org

Hi, Is there any way where we can have joined subclass with a different primary key than the super class. Eg: Person Table =========== Id -PK (ORACLE SEQ) fname - VARCHAR lname - VARCHAR Customer Table =========== Id - PK (ORACLE_SEQ) prop1 - VARCHAR prop2 - VARCHAR personId - FK - Person(Id) Having this kind of table structure, if we have ...

92. Please Help Mapping Subclassing with one table per class    forum.hibernate.org

We have 2 tables in the database which represent animal and human patients. animal and human java objects extend patient interface I have written the mapping files for these so we can save and get animal or patient from database. However, I have a reciept object which needs a patient on it, which will need to be either human or animal ...

93. Use the special property 'class' with union-subclass mapping    forum.hibernate.org

I my application, I use a table per concrete class hierarchy strategy. I didn't introduce a discriminant column into my tables as this information is useless for Hibernate with this mapping. My mapping file looks like: ...... ...

94. @ManyToMany mapped to joined subclass    forum.hibernate.org

95. Overriding Annotations in subclasses    forum.hibernate.org

96. table-per-subclass, discriminator using formula    forum.hibernate.org

Newbie Joined: Wed May 07, 2008 8:00 pm Posts: 3 I'm attempting a table-per-subclass mapping using a discriminator that is from a formula Basically if the group type of the carrier is 1, then I need to get the product codes from 'CFG_PRODUCT_CODE', if the carrier group type is 0, then I want to get the product codes from CFG_RELOAD_PROD_CODE. I ...

97. Creating a child entry only when using joined-subclass    forum.hibernate.org

I need to create a row in my child table without creating a row in my parent table (since it already exists). Is there any way to do this? Here's a sample hbm file: Code:

98. filter or query by subclass and by filter    forum.hibernate.org

Hi, i was wondering if it was possible/how to. restrict the results of a set, by both a subclass, and or daterange. currently i'm using a filter for the daterange, but if it is a recurring event, I want to ignore the filter.