subclass 7 « Map « JPA Q&A





1. Inheritance - Table per subclass problem    forum.hibernate.org

Beginner Joined: Wed Jul 26, 2006 11:52 am Posts: 23 Location: Edinburgh, Scotland First of all i've this is a problem i'm having with NHibernate, sorry for posting it here as well as in the NHibernate forum but I really need a solution to it....if I shouldn't be posting to both forums let me know and I wont do it again. ...

2. Adding a column to DB breaks subclass queries    forum.hibernate.org

Author Message canales Post subject: Adding a column to DB breaks subclass queries Posted: Mon Oct 02, 2006 7:07 pm Newbie Joined: Wed Nov 02, 2005 1:17 pm Posts: 13 I've attempted to add a single column to an existing Hibernate created DB table that is associated with the root class of a inheritance hierarchy ( i'm using "table ...

4. Returning a subclass as a superclass.    forum.hibernate.org

Hi, I'm posting this question on the general Hibernate forum to ensure best visibility. I have a class A and a subclass B that extends A. From our business model point of view, A is the "light" version of B, containing only some basic informations ; whereas B is a more complete definition of our concept. Note that both are valid ...

5. filter subclass    forum.hibernate.org

Hi! There is one thing I'd find REALLY usefull in my project: filter subclasses. How do I do this? I have a and I'd like to apply a filter that makes sure this class is only instantiated based on a column value. This is easy and works very good on normal classes, how come the DTD won't allow me to ...

6. Timestamp in subclass    forum.hibernate.org

7. join on subclass of a property class    forum.hibernate.org

I have a class "Timelog". This class has a property called "expense". Expense is of type "Expense". The trick is that "Expense" is an abstract class and it has 3 implementations: "Project", "Overhead", and "Maintenance". Now I have a very simple thing to do. I need to find all the timelogs that have expense of type Maintenance. I would like to ...

9. Updating from one subclass to another subclass    forum.hibernate.org

I have a "Table per class hierarchy" with mapping as follows .... seq_contact ...





10. tooo long query with joined-subclass    forum.hibernate.org

11. Why does joined-subclass not support caching?    forum.hibernate.org

12. Independently Populate Class & subclass - Duplicate Reco    forum.hibernate.org

Newbie Joined: Thu Nov 02, 2006 7:35 pm Posts: 4 Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version:3.1 Mapping documents: ...

13. Joined-Subclass: Howto save parent as subclass    forum.hibernate.org

I have 2 classes mapped as joined subclass: @Entity @Inheritance(strategy=InheritanceType.JOINED) class A{ @Id @GeneratedValue private Long id; } @Entity @PrimaryKeyJoinColumn(name="id") class B extends A{ } I have created and saved object A, but now I would like to save the same object as B. The only things that seem to work are: 1. copying all data to B, delete A and ...

14. proper mapping strategy for subclasses    forum.hibernate.org

You can go for the discriminator which is good apart from the fact that it will not allow constraints like not null check. If that is an issue for you then use joined-subclass which is table per subclass. There is a tradeoff here as well as everytime it will query an extra table namely your generictable. Hope this helps. Please do ...

15. Properties in superclass map file breaks subclass queries    forum.hibernate.org

Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message stevewickii Post subject: Properties in superclass map file breaks subclass queries Posted: Mon Nov 20, 2006 4:03 pm Beginner Joined: Mon Apr 24, 2006 9:47 pm Posts: 33 Location: Kansas City, MO I need to be ...

16. Using a one to many reference to a joined-subclass entity    forum.hibernate.org

Hibernate version: 3.2.0 Hibernate tools version: 3.2.0.beta8 In simplified terms I have an object, call it a Forest, that contains (one to many) other objects that are similar to each other, for example Deer and Bear which both extend from the generic class Animal. I am trying to add to my Forest mapping document two collection mapping sets: one for the ...





17. Persist subclass instance with superclass mapping    forum.hibernate.org

I don't know if this would work, but here is my idea. Define an interface, call it I, that A implements. Define the hibernate mapping for the interface only. Define only those properties that you want saved. The problem I see is how would Hibernate know which concrete class to instantiate when it loads an object from the table? It's not ...

18. query criteria on subclass    forum.hibernate.org

Hibernate version: 3.2.0 Mapping documents: true true

19. Best way to change a subclass into a superclass?    forum.hibernate.org

Hi I've got two tables, one of which is an extension of the other using the joined-subclass mapping. So I have PpiProduct extends Product Saving and deleting them is fine, but I was wondering what the best (only?) was of converting one into the other (say the user edits a Product, and sets a flag that means its now a PpiProduct) ...

20. Inheritance Mapping     forum.hibernate.org

21. union-subclass - can I keep my base classes?    forum.hibernate.org

22. Map subclass to parent class table with     forum.hibernate.org

23. Query by Superclass - return any subclasses    forum.hibernate.org

Is it not possible to query by superclass? ie if I have superclass that may or may not be persistent, may or may not be abstract and a bunch of concrete persistent subclasses. (eg in a single table per hierachy where MyTop maps to the single table) Code: ...

24. Proxy derived from wrong subclass    forum.hibernate.org

Newbie Joined: Fri Dec 29, 2006 10:43 am Posts: 2 I have an application which has quite a large number of classes/tables (hence its difficult to attach all the hbm.xml files and source). The app worked fine in 2.x and I'm now trying to migrate to 3.x of hibernate. The problem I am getting is on a particular table/class that has ...

25. How to return proper discriminator subclass in where-clause?    forum.hibernate.org

Hello, I have the following object model in which various "type" classes (BooleanAttribute, DateAttribute, etc.) subclass from an AbstractAttribute class. The subclasses store their values in type-specific columns through the use of a discriminator. I'm trying to construct an HQL query where I'm returning BooleanAttributes whose value is "true". The problem is that even if I include a ".class=" statement in ...

26. Having trouble with bulk update/delete on joined subclasses    forum.hibernate.org

org.hibernate.exception.GenericJDBCException: could not insert/select ids for bulk update at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.hql.ast.exec.MultiTableUpdateExecutor.execute(MultiTableUpdateExecutor.java:127) at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:396) at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:259) at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1141) at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:94) at test.MyTest.main(MyTest.java:51) Caused by: java.sql.SQLException: Ambiguous column name 'id'. ...

27. table per subclass with discriminator?    forum.hibernate.org

Are you able to change the schema at all? Specifically, can you combine the discriminators in A and B into a single discriminator (perhaps as A.B)? If so, you can use the 'table per subclass, with a discriminator' pattern. Something like: ... ... (A's properties)

28. instances of a class without its subclasses    forum.hibernate.org

29. Column ambiguously defined exception with union-subclasses    forum.hibernate.org

Newbie Joined: Fri Dec 01, 2006 10:01 am Posts: 6 Hi, I'm having this strange annoying problem: Hibernate is generating a query for me that gives the ORA-00918: column ambiguously defined error. What i have is the following : in my legacy database there exist two types of modules, Application Modules (Applmod) and Communicator Modules (Communicator). The schema i have build ...

30. Problem using join in subclass    forum.hibernate.org

Hi -- I'm trying to mix table per class and table per subclass mappings and I'm running into an exception when using property elements inside of the join element. I am using Hibernate 3.1.1 My mapping looks like this: Code: ...

31. many-to-many association and joined-subclass    forum.hibernate.org

Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message Cue Post subject: many-to-many association and joined-subclass Posted: Sun Jan 28, 2007 6:18 am Regular Joined: Tue May 04, 2004 6:15 am Posts: 51 Mapping documents: CategoryImpl Code:

32. Figuring out the instance of the subclass    forum.hibernate.org

Basically I have a hibernate class say X. X has one sub class Y. There is another hibernate class Z that holds a collection of X (or Y). When I retrieve the collection and do an instanceof X/Y and if the object in the collection should have been of class Y (sub class) it always shows the object as being of ...

33. Abstract joined-subclass still generates create table    forum.hibernate.org

Even though "abstract" is set to "true" DDL is generated to create a table for an abstract class mapping. The Java class is marked as abstract and there are 2 concrete classes also mapped (one is below). Each Java class (abstract and the 2 concrete) have separate mapping files. Also why do I have to I'm using org.hibernate.tool.hbm2ddl.SchemaExportTask to generate the ...

34. Exclude Subclass from Criteria Query    forum.hibernate.org

Using Hibernate 3 is it possible to create a criteria query that will exclude subclass from the results: class Foo class Bar extends Foo Bar is mapped in hibernate as a subclass of Foo (joined-subclass in my case) I would like to be able to write a criteria query that returns only objects whose class is Foo, not objects whose class ...

35. Issue with union-subclass & array & abstract=true    forum.hibernate.org

1. Transaction save = session.beginTransaction(); 2. Library library = new Library("Santa-Clara-Library", "Santa Clara"); 3. library.setId(1); 4. SoftwareBook book1 = new SoftwareBook("K&R","C++"); 5. SoftwareBook book2 = new SoftwareBook("Routing", "Networking"); 6. Book[] books = {book1, book2}; 7. library.setBooks(books); 8. ...

36. Cast betwen Subclasses    forum.hibernate.org

Hi I have the following structure: Class Organisation mapped to TORGANISAT table, it contains an Id and some general fields and there are some Sub-classes and DB table with a foreign key (fk_torg_laufnr) to the organisation table for each subclass. The Mapping looks something like that: Code:

37. problem with     forum.hibernate.org

hi, all: Right now I have problem with hibernate mappings: I have 3 classes as following: Class A { private OtherClass1 other1; } Class B extends A { private OtherClass2 other2; } Class C extends B { } I use one table to map the whole inheritance(table per class hierarchy). The mapping file is like this: <

38. subclass one-to-many    forum.hibernate.org

40. Order on Joined-Subclass    forum.hibernate.org

Newbie Joined: Tue Jun 07, 2005 1:10 pm Posts: 1 Hi All! I'm having problems with ordering a select result with a joined-subclass. I looked for the way to do this, but I didn't found. The tables: Code: CREATE TABLE agente ( agecod serial NOT NULL, agenom varchar(100), ageobs varchar(70), CONSTRAINT agente_pkey PRIMARY ...

41. Version NPE with joined subclass    forum.hibernate.org

Newbie Joined: Fri Mar 09, 2007 5:18 pm Posts: 2 Hi all, I am getting a NullPointerException when trying to save a Hibernate-managed entity modeled as a joined subclass (stacktrace at bottom of the post). The subclass previously did not have an additional table, so this problem was introduced when I introduced the joined-subclass mapping. The mentions of the stacktrace I ...

42. Dynamic ordering for subclass fields    forum.hibernate.org

private List findByQueryParamArrayPaginated(String query, Object[] params, int page, int pagesize) throws DataAccessException { Session s = this.getSessionFactory().openSession(); Transaction tx = s.beginTransaction(); s.setFlushMode(FlushMode.COMMIT); Query q = s.createQuery(query); q.setMaxResults(pagesize); q.setFirstResult(page * pagesize); for (int i = 0; i < params.length; i++) ...

43. Help: Mixing and     forum.hibernate.org

I have a situation in which I think I need to mix the and

44. Inheritance and subclasses fetching    forum.hibernate.org

Actually, I can't change the class hierarchy. The thing is that the base class is a part of the existing application. And in that application there are a lot of queries for a base. Now I need to add a child of the base, but all that queries should fetch the base only.

45. Duplicate column creation for subclass with a join    forum.hibernate.org

I'm using hibernate v3 and have found a certain aspect of the created tables for subclasses declarations confusing. My mapping is as follows: Code: ...

47. Persitence Issue with Joined-Subclass    forum.hibernate.org

Hi all, I have a problem with persisting an object hierarchy. I have 2 tables Contacts and Users. I have used joined-subclass approach to model these tables where Users is a subclass of Contacts. Not all contacts are users of the application. I have a association from a another class (let's say List) which will have a collection of Contacts. The ...

48. Inheritance with "Table per Subclass" question    forum.hibernate.org

Hibernate version:3.2 Hi, I am attempting to map an existing database using hibernate. The database models the following structure Code: Class C extends Class B Class B extends Class A It implements this in this table structure Code: Table A primary key of A_ID(Identity - Auto Generated) Table B primary key of B_ID(Identity - Auto Generated) + foreign key of A_ID ...

49. Inheriting properties without mapping a subclass.    forum.hibernate.org

[b]Hibernate version:/b]3.2 Hi everybody, I wonder if anyone can help in this problem. I have a large number of entities, around 40, which need to have a many to one relation to another entity, say Master. I'd would like to use class inheritance to map the relation to the Master. But I wouldn't like to map every entity as a subclass ...

50. joined-subclass and accesing associations    forum.hibernate.org

Hi, I have a joined-subclass situation as given below. The sub-class as such works as expected and I'm able to fetch the correct type of sub-class. However when I try to access a collection in the sub-class, it gives me the following exception: Apr 3, 2007 2:29:10 PM org.hibernate.util.JDBCExceptionReporter logExceptions WARNING: SQL Error: -1, SQLState: 22018 Apr 3, 2007 2:29:10 PM ...

51. Criteria projection bug with table per subclass mapping    forum.hibernate.org

I believe I have found a bug when using projections via the criteria api in a table per subclass hierarchy. I essentially have 4 different tables. Table A is the parent of Tables B, C, and D, e.g. table B, C, and D have a reference to the PK of Table A via a FK. I have classes ClassA, ClassB, ClassC, ...

52.  'where' clause problem    forum.hibernate.org

I started using , mainly for polymoriphic associations. I spotted some performance issue with selecting top level abstract objects by 'where' clause. Imagine AbstractAB and two concrete subclasses ConcreteA and ConcreteB. While getting AbstractAB by id hibernate issues something like: select a.* (select * from ConcreteA union select * from ConcreteB) as a where a.id = ?. And here is the ...

53. Add object with property already exist (Joined-subclass)    forum.hibernate.org

I've a problem with Hibernate. I've have inheritance mapping with xdoclet joined subclass The structure of my objects When I add a new GeplandVerlof (subclass from Afspraak), with a setted TerugkeerPatroon, there is no problem. Multiple adds (different GeplandVerlofs and the same TerugkeerPatroon) goes fine too. (he adds objects from properties too) When i try to add in a new function ...

54. ont-to-one in joined-subclass    forum.hibernate.org

Hi I am using hibernate 3.x to persist a mySQL data base. This is my first project using hibernate I have created the mapping document POJOS and I can generate the database. However I have some doubts about the way the database is generated I have a Joined-subclass that has a one-to-one element. In the generated database tables I couldnt find ...

55. Help with subclassing    forum.hibernate.org

56. Update HQL for subclass    forum.hibernate.org

...

57. Unioned Subclasses with Conflicting Column Types    forum.hibernate.org

Hello All, I am in the process of migrating an existing object model and data model to use Hibernate, replacing a legacy ORM framework. The object model and data model use/require a TABLE_PER_CLASS inheritance model. The problem I have encountered is that the union select query generated by Hibernate is not detecting conflicting data types if the concrete classes define the ...

58. Exception with mapped one-to-many set from joined-subclass    forum.hibernate.org

Newbie Joined: Mon May 14, 2007 2:07 pm Posts: 1 Hibernate version: 3.2.0 The generated SQL (show_sql=true): Code: select areasofcou0_.countrycode as countryc3_1_, areasofcou0_.code as code1_, areasofcou0_.code as code2_0_, areasofcou0_1_.isactive as isactive2_0_, areasofcou0_1_.countrycode as countryc3_2_0_, areasofcou0_.name as name3_0_ from TLAreas_en areasofcou0_ inner join TLAreas areasofcou0_1_ on areasofcou0_.code=areasofcou0_1_.code where areasofcou0_.displayforhotels = 1 and areasofcou0_.countrycode=88 order by areasofcou0_.name; Hi. I have a problem ...

59. Querying for a subclass    forum.hibernate.org

Hi everyone! I'm sorry, is there a way to query for a property type? Here's my case: I have 3 classes, mapped as Code: ...

60. complicated table per subclass mapping issue    forum.hibernate.org

Newbie Joined: Thu May 17, 2007 8:08 pm Posts: 1 Currently using hibernate 3.2. I have a mapping that Canvas has a collection of Textbox and PhotoHole. Textbox or PhotoHole is actually subclass of CanvasWidget. I am using table per subclass approach. One Canvas has unidirection one-to-many Textboxes and PhotoHoles.

61. Inherited relationships not found in collection of subclass    forum.hibernate.org

Consider: @Entity public class A { @Id @GeneratedValue protected int id; @OneToMany(mappedBy = "a") protected Collection c; } @Entity public abstract class B { @Id @GeneratedValue protected int id; @ManyToOne protected A a; } @Entity public class C extends B { } Gives the following errors upon deployment: Caused by: org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.gd.iewtpt.isi.C.a in com.gd.iewtpt.isi.A.c ...

62. modify type value in "table per subclass"    forum.hibernate.org

I'm pretty sure that's impossible. What you actually want to do, is change the type of an object, which is impossible in Java. Since Hibernate maps to Java objects, it makes sense that Hibernate disallows it as well. Consider that you already have a reference to the object, then magically change the type of said object through hibernate... what would happen ...

63. joined-subclass and many-to-many associations    forum.hibernate.org

I have an interface called "Folder", which is implemented by two subclasses: "FolderA" and "FolderB". FolderA contains a set of any number of FolderBs, and FolderB contains a set of any number of FolderAs. I have another class, "FileCabinet", which contains a Set of folders of either type - this is why I'm using explicit inheritance in the first place. I ...

64. Mapping not selecting subclass    forum.hibernate.org

65. Hibernate, PojoEntityTuplizer : Subclass and Proxy    forum.hibernate.org

Hi, I use Hibernate and JBPM, here is my architecture : java : sequenceNode inherited from node hbm : sequenceNode mapped as subclass of node with discriminator and a proxy (to enable cast). node as declared in JBPM. I had an exception when initializing hibernate. MappingException("proxy must be either an interface, or the class itself: SequenceNode) After debug : SequenceNode with ...

66. different sets for subclasses of same base class    forum.hibernate.org

Hi I am looking for solution for following problem: I have a class User which has two collections (Comments and ProperContentItems). Comment and ProperContentItem are subclasses of abstract class ContentItem. All of them are persistable. Mapping strategy is table-per-hierarchy with discriminator called "CONTENT_TYPE". I am using XDoclets, and definitions concerned are as follows: ... /** * @hibernate.set * inverse="true" * lazy="true" ...

67. Subclass w/ discriminator an One-to-many association problem    forum.hibernate.org

Hello, I push this topic up since it's unsolved and I'm getting exactly the same problem. Also, when cascade="all-delete-orphan" is set in the bag definition, and when deleting a Cage, only rows from the "domesticCat" table are deleted, the corresponding rows in the "cat" table are left. However, when deleting a specific DomesticCat, the corresponding Cat rows are also deleted. Sounds ...

68. Table-per-subclass or Table per class hierarchy?    forum.hibernate.org

Hi there, I've the following modelling situation: One root class, A, with few attributes. Eight small subclasses of A, also with few attributes(Tipically, only one). Our application will perform lots of queries using this class hierarchy. Quantity of itens registered in the database will grow a lot (millions of registers), without predominance of any of the subclasses. After explanation, what inheritance ...

69. Table per subclass and NonUniqueObjectException    forum.hibernate.org

Firstly, let me apologize if this is a stupid question, I have been through the FAQ's, I bought the recommended book Java Persistence with Hibernate. It is such a simple question I feel so stupid, but it is annoying me so I though I would ask, an hope you don't all beat me up :) So using the example in the ...

71. inheritance mapping and type changing between subclasses    forum.hibernate.org

How are you planning to do the "promotion" in java? if you have 2 seperate classes for the user types - you're going to have to : //write a constructor that does the data copying and instantiation //for the AdvancedUser class AdvancedUser au = new AvancedUser(simpleUser); Hibernate.delete(simpleUser); //exit session here !!! very important!!! au.setId(simpleUser.getId()) Hibernate.save(au); //preferably force flush() here too...

72. Configuration bug with deep joined-subclass hierarchies    forum.hibernate.org

I am currently working with a deep (6-level) joined-subclass hierarchy. Objects are identified with 32-character string UUIDs. However, the SchemaExport tool creates VARCHAR(255) PK columns instead of VARCHAR(32) for some of the classes - specifically, the classes that are at the bottom of the hierarchy. Looks like the Configuration.secondPassCompileForeignKeys method doesn't properly traverse the foreign key references, and alignColumns() method is ...

73. collection with subclasses - insert them to their tables    forum.hibernate.org

Hello all. I have a problem with a collection with implicit polimorphizm. I have classes: Container (table CONTAINER), Parent (PARENT) and Child(CHILD). Child extends Parent. Container has a set of Parent objects, mapped like this: The set in Container is HashSet. Both Parent and Child are mapped ...

74. Problem with subclass mapping    forum.hibernate.org

Dear all I created this mapping and hibernate 3.1 refuses to load it with a non-specific message: "Could not read mappings from resource: com/softwareag/seicr/dao/Modification.hbm.xml" I am desperate by now and at the end of my resources or maybe I got blind to see errors. Could anyone please take a look at this mapping and maybe spot some errors? Your help ...

75. Exception when querying for property of subclass    forum.hibernate.org

Hi, I get a SQLGrammarException when executing a hql-query for a superclass that contains properties of subclasses. The property is mapped in more than one subclass. This may be the problem. Hibernate version: Hibernate 3.2.5.ga Hibernate Annotations 3.3.0.ga Mapping documents: Using Annotations, annotated classes are: Code: import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.Table; @Entity @Inheritance(strategy = ...

76. Exception when querying for property of subclass    forum.hibernate.org

Hi, I get a SQLGrammarException when executing a hql-query for a superclass that contains properties of subclasses. The property is mapped in more than one subclass. This may be the problem. Hibernate version: Hibernate 3.2.5.ga Hibernate Annotations 3.3.0.ga Mapping documents: Using Annotations, annotated classes are: Code: import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.Table; @Entity @Inheritance(strategy = ...

77. Polymorph="explicit" and joined-subclass problem    forum.hibernate.org

Hibernate version: 3.2.2 Mapping documents: Code: ...

78. The subclass with same id in two tables    forum.hibernate.org

79. Problem with subclass & collection    forum.hibernate.org

Author Message jamesmdr Post subject: Problem with subclass & collection Posted: Mon Sep 03, 2007 8:55 am Newbie Joined: Mon Sep 03, 2007 8:48 am Posts: 1 Hi, I have a problem with hibernate version 3.1.3, I have four classes that must have a relation like that: public class NegociacaoTarifa { } public class NegociacaoPlano extends NegociacaoTarifa { ...

80. mapping a subclass as a componenet?    forum.hibernate.org

hi there, i don't know hot to define this, so i'll explain.. i have a class called AbstractCaseAttribute, which has several implementations. essentially, it's a field which a common dominator of integer which states the meaning of the field (property called TypeId, which could be for example 7 for name, and 9 for age). the sub-implementation represent the type the field ...

81. Accessing to association defined on subclass    forum.hibernate.org

Hello Hibernate developers and community people, I am aware that HQL (in Hibernate 3.2) allows accessing to an association defined on a subclass through its superclass (I will describe in detail below), and I am posting here because I would like to make sure that this was a designed behavior but not incidental. I would appreciate if I could get information ...

83. Object with id: 76 was not of the specified subclass SOLVED!    forum.hibernate.org

Beginner Joined: Tue Mar 15, 2005 5:04 am Posts: 26 Hi Everyone, I am loading Objects from one table that are coming from many subclasses. So hibernate has to instanciate the Objects as subclasses that are being mapped in a singleclasstable Mapping. When loading hibernate always crashed in the error that you can see in the subject + de.datentraum.accounting.Account (Discriminator: AGRP ...

84. XdocletUnable to specify the data type of the subclass    forum.hibernate.org

I am using hibernate 3 and Xdoclet to build the mapping files and export the schema of my SQL Server 2005 database. I am using 'table per subclass' approach to map a class hierarchy to a relational database. Although, I am having difficulty specifing the data type for foreign key of the subclass. For example, say I have three two classes: ...

85. Query for subclass property sees just 1 subclass    forum.hibernate.org

select this_.id as id88_0_, ..., this_1_.numerodocumento as numerodo2_89_0_, this_2_.numerodocumento as numerodo2_90_0_, ..., this_4_.numerodocumento as numerodo2_92_0_, ..., case when this_3_.id is not null then 3 when this_1_.id is not null then 1 when this_2_.id is not null then 2 when this_4_.id is not null then 4 when this_.id is not null then 0 end as clazz_0_ from movimento this_ left outer join ...

86. Problem with subclasses in 2.0.3    forum.hibernate.org

I'm upgrading from 2.0.1 to 2.0.3 and some of my mappings have stopped working. I have several places where I use lookup tables to map to state objects, which use the primary key as the discriminator. Here is an example: Code: ...

87. Subclass join by Foreign Key and the value of another field    forum.hibernate.org

Hibernate 3.2.5, MySQL 5.0.24 I'd like to further constrain the join used in a subclass beyond just the foreign key. I'm using table per subclass to map this particular class hierarchy. I have a status field in the subclass table I'd like to check for a value of 'A'. I have tables: participant, bank, store where banks and stores are participants ...

88. Problem with filter in joined-subclass map    forum.hibernate.org

Newbie Joined: Mon Mar 06, 2006 7:25 am Posts: 10 Hibernate version: 3.2.4ga Mapping documents: Code: ...

89. one-to-many association to subclass    forum.hibernate.org

90. saveOrUpdate question with subclassing/many-to-one    forum.hibernate.org

Hello, hibernate newbie. I have a question with using saveOrUpdate with a subclass many-to-one. I invoke the method above and it inserts instead of update. Any insights or assistance is greatly appreciated. Using the unsaved-value attribute didn't seem to help (it helped in my other mappings). I read the faq and forum and couldn't find a solution to what I am ...

91. subclass and entity-name    forum.hibernate.org

Hi all, I am using Hibernate 3.1 and I am facing a problem mapping object hierarchy to different tables. I have the class hierarchy: Code: abstract class Criterion {} class StringCriterion extends Criterion {} class StatusCriterion extends Criterion {} I have an appropriate mapping file: Code: ...

92. Retrieving subclass object causes ClassCastException    forum.hibernate.org

There is some fundamental thing about inheritance mapping that I don't get. I'm creating a generic attribute system, which should be able to store strings, floating point numbers and integers. The abstract base class is called AttributeValue, extended by StringAttributeValue, DoubleAttributeValue and LongAttributeValue. The test cases attempt to store and retrieve values of all three types. Storing the values goes fine, ...

93. Overriding fields with subclass in other table    forum.hibernate.org

Hello, I'm quite new to hibernate. I'm sorry if I'm posting something redundant or that I should have figured out myself from the doc, but I can't find any example similar to what I want to achieve. Which could mean I'm doing something wrong. Basically, I have a class which is: Code: public class MainBundle { int id; String description; Date ...

95. Problem with mapping union-subclass    forum.hibernate.org

Beginner Joined: Tue May 11, 2004 8:24 am Posts: 23 Hi, can anyone help me to find the problem in the following mapping. There are no problems on runtime, but schema-export fails. On latest hibernate version 3.2. Many thanks in advance. Alex Code:

96. Where to place comment elements in     forum.hibernate.org

I am trying to include some comments in the generated SQL tables using Hibernate. Comments for tables and columns are properly generated, except in the case of tables declared with union-subclass. In the example below, the comment for in the "table of fathers" is not generated. Any ideas what I am doing wrong? ionathan Code:

97. I don't know how to mapping an index in a subclass    forum.hibernate.org

Hi, I have the follow problem: I have an abstract class call PersistentObject that has a instance variable call creationTimestamp and it has a method call getCreationTimestamp(). This method has two annotations: @Temporal(TemporalType.TIMESTAMP) @Column(name = "CREATION_TIMESTAMP") Then I have a subclass call Case and in this class I want to put an index for the creationTimestamp. I wouldn't like putting the ...

99. [solved] Inheritance: how to query subclasses ?    forum.hibernate.org

100. Problem with union-subclass    forum.hibernate.org

Newbie Joined: Thu Jan 10, 2008 7:48 pm Posts: 3 I have two java classes: Code: public class User implements Serializable{ private int id; private String username; private String password; protected User(){ ...