subclass 4 « Map « JPA Q&A





2. Many-to-many is not aware of discriminators/subclassing?    forum.hibernate.org

Hi there, I am pretty new to Hibernate so I may be going about the below completely the wrong way.. I have an Asset class that has two many-to-many relationships to a Keyword class as follows.. And the Keyword class.

3. Using a Subclass to implement relationships    forum.hibernate.org

I am trying to pass domain objects down to the presentation layer via web services (AXIS), allow changes made to the disconnected data, send it back up and update the database. For ease of use, I would like to pass the hibernate objects down themselves. This works fine until I introduce any relationships or collections. The presentation layer does not need ...

4. using outer-join with 'joined subclasses'?    forum.hibernate.org

Hibernate version: 2.1.6 Hi there, is it possible to use outer-join with "joined-subclasses"? Background: It's not possible to add a version-column to exisiting database-tables (due to existing applications which should not be changed). Therefore i want to add a seperate table for versioning. The version-information is kept in a root-class (for each object a different one). The mapping will work via ...

5. HQL query through/in a joined-subclass    forum.hibernate.org

Newbie Joined: Fri Sep 17, 2004 7:06 am Posts: 2 Location: Germany Code: Attribute value base ...

6. joined-subclass tries to insert in the parent class' table    forum.hibernate.org

Now that I am using the jTDS driver I no longer have the re-read problem that I had with the SQL Server driver. However, I have some unexpected behavior for a joined-subclass. When the joined-subclass object is inserted, hibernate tries to insert it into the parent class' table. As I understand the mapping, the tables are distinct. Why does it do ...

7. joined-subclass tries to insert in the parent class' table    forum.hibernate.org

Now that I am using the jTDS driver I no longer have the re-read problem that I had with the SQL Server driver. However, I have some unexpected behavior for a joined-subclass. When the joined-subclass object is inserted, hibernate tries to insert it into the parent class' table. As I understand the mapping, the tables are distinct. Why does it do ...

8. Can you define joined-subclasses in separate mapping files?    forum.hibernate.org

Thanks guys - that works a treat. I was wondering why I couldn't define another in my derived class, but thinking about it, I like the way Hibernate makes it more like Java inheritance. Don't know if you guys are involved in the development of Hibernate, but I think it's a great product and I've only just started playing with ...

9. Inserting a subclass, but want to retrive it as the supercla    forum.hibernate.org

Hi, I have created a table containing two types of objects: BatchInfo and Batch objects. The Batch class is a subclass of BatchInfo. I want to insert a Batch object into the table, and thereafter retreive it as a BatchInfo object. Is it possible ? Thanks. My xml file: --------------------------------------





10. one-to-one association with a subclass using a discriminator    forum.hibernate.org

Author Message clajoie Post subject: one-to-one association with a subclass using a discriminator Posted: Tue Oct 26, 2004 11:35 am Beginner Joined: Sun Oct 03, 2004 8:50 am Posts: 32 Location: McLean, VA I'm trying to use a one-to-one association between my person object and an email address object. The email address object is a subclass of ElectronicAddressVO with ...

11. How to determine subclass from a query on superclass?    forum.hibernate.org

I have the following class scheme: + Contract (extended by) + ConfidentialDisclosureAgreement + ConsultingAgreement with the following maps (joined-subclass): I am doing a simple query ...

12. duplicate import problem with homonymous subclass    forum.hibernate.org

Beginner Joined: Sun Aug 29, 2004 7:21 pm Posts: 26 I have a class : com.seanergie.authentication.Role, and a subclass com.platre.authentication.Role So, in my hibernate-mapping document, H vabe a that holds a . The full mapping document is bellow. This generates a MappingException: duplicate import: Role The full stack trace is bellow. But if the subclass has a slightly ...

13. fetch all subclass    forum.hibernate.org

Hi Is there a way to get all the subclass ? I have a discriminator on the parent class. When i do a query like createSQLQuery("SELECT {c.*} from Animal{c} where name LIKE :name","c",Animal.class ); I am getting only Animal class. No cat or camel is retrieved. Is there a way to get all ? Thanks

14. Problem with group by and subclasses    forum.hibernate.org

Hi I'm using Hibernate 2.1.3 on sapdb 7.4. I'm trying to do an HQL query on an class that is extended by another class via joined subclass. so class B extends class A I want to do a query like select ...., count(A.id) from A where ..... group by ..... The problem is the group by. It wants the columns from ...

15. subclass instance from existing superclass    forum.hibernate.org

Dear tribe, I'm trying to figure out how to create an instance of a subclass for an instance of a superclass that already exists. Consider two subclasses, Human and Woman (a joined-subclass of Human). Now, suppose i have a human record with 1 as the primary key. I tried creating the subclass instance like: Code: // get the superclass instance first ...





17. Problems with persistence of joined-subclass table    forum.hibernate.org

Hibernate version: 2 Mapping documents: Name and ...

18. Lifecycle API not called from discriminator subclasses    forum.hibernate.org

Hi, I'm attempting to setup a couple of subclasses for my Order entity, CreditCardOrder and ComplementaryOrder. I believe that my mapping configurations are setup properly and the discriminator subclassing stuff is working. But, I've hit a snag doing inserts of my subclasses. Our standard base Order class implements Hibernate's Lifecycle API. We need to perform a couple of tasks each time ...

19. select after a property of subclass    forum.hibernate.org

Hi, Does hibernate allow to select objects after some property of its subclass? Let's say I have the object Person { String name; int age; ... } and its subclass Student { String university; ... } can I generate a HQL query to get all persons which are students and with university="Harvard"? I know about .class property for an object but ...

20. Changing Between Subclasses on Update    forum.hibernate.org

Hibernate version: 2.1.4 OK, this is a general question. I haven't been able to find any documentation on how exactly this is supposed to work, and I haven't been able to get it to work to my satisfaction. Let's say I have a DomesticCat and an AlleyCat, both of which map to the CAT table. I also have a Person class. ...

21. joined-subclass with timestamp versioning fails for Oracle    forum.hibernate.org

Hi All I've a class B and a subclass SubB. They are maped with a joined-subclass mapping. B is versioned with a timestamp. For MySql everything works fine. If I do the very same thing for Oracle 8.1.7 I get a StaleObjectStateException, because an update to the B table fails. Even more strange: I log the SQL statements with p6spy. If ...

22.  with fails for Ora    forum.hibernate.org

Hi All I've a class B and a subclass SubB. They are maped with a joined-subclass mapping. B is versioned with a timestamp. For MySql everything works fine. If I do the very same thing for Oracle 8.1.7 I get a StaleObjectStateException, because an update to the B table fails. Even more strange: I log the SQL statements with p6spy. If ...

23. joined-subclass and delete cascade    forum.hibernate.org

Is there an option to add "ON DELETE CASCADE" to the foreign key generated as a result of a joined-subclass? For example, if I have class Child defined as a joined-subclass of Parent using the key "foo". Then Hibernate would issue a: ALTER TABLE Child ADD CONSTRAINT "FKxxxxxxxx" (foo) REFERENCES Parent; However, this is missing a "ON DELETE CASCADE". As a ...

24. Newbie Mapping/Subclassing Question    forum.hibernate.org

Hello, Im using Hibernate 3 from CVS. Ive read the documentation multiple times but I think Im going to need some help getting over this initial hurdle then hopefully other things will click. Lets say I wanted to model something like the following (collectively called entities): corporation | subsidiary | department So just to confirm, if each of these are going ...

25. one-to-one association between two joined subclass?    forum.hibernate.org

Has anyone encountered the above problem before? Can two subclasses (joined-subclass), having the same parent, have an association together; whether it be one-to-one, one-to-many, etc. Below is a unit test on the save method. I am not getting any errors, everything gets updated, however, the student id (entity_id) is not the same in the demographic table. They should be the same ...

26. Delete of subclass delets the superclass also    forum.hibernate.org

Problem:When i delete a subclass object (HhgDriver) Hibernate also deletes the the superclass object (Load) from the tables in DB.Whereas i just want to delete the subclass object and not the super class object.Similarly when i try to insert subclass object (HhgDriver) Hibernate also inserts the the superclass object (Load) in the tables in DB.How can i overcome this problem? The ...

27. HQL query in one-to-many and subclass    forum.hibernate.org

Product and Attribute are one-to-many relation. Attribute has subclass AttributeColor and AttributeWeight and so on. How to query these product which has special color? In native SQL, it would like this: select product.* from product, attribute where product.id = attribute.pro_id and attribute.color = ? But, in Hb, Attribute doesn't include pro_id property (instead, method in Product : Set getAttributes()) I also ...

28. critera search on subclasses    forum.hibernate.org

Hi.. I'm trying to do a critera search. I have 4 subclasses that extends my "animal" class. Lets say that the 4 subclasses are, "cat", "dog", "fish" and "rat" The thing I'm trying to do is: Criteria aniamlCrit = hibernateSession.createCriteria(Animal.class); and then add something like: animalCrit.add(Expression.eq("dog.name", "Fido"); animalCrit.add(Expression.eq("cat.sex", "male"); I want to get Animal objects from this... with all dog's having ...

29. many-to-one to subclassing retrive the also parent class    forum.hibernate.org

Hello , i am a new forum user. I'm trying to implement a polymorphic mapping using the subclassing strategy. I map the superclass A with the discriminator DISCR, and 2 subclasses SUB1 (when DISCR=1) and subclass SUB2 (when DISCR=2). Now, i've a class (name e.g. B ) that has a many-to-one reletionship with the subclass SUB1 , but i dosen't work: ...

30. Problem with one to many and subclass    forum.hibernate.org

Hibernate version: Hibernate 3.0 Mapping documents: ........ ........

31. Joined Subclass question    forum.hibernate.org

Hibernate version: Hibernate 2 is preferred as we're using the Spring Framework, but I can use 3 if neccessary Question I have used Hibernate a fair amount, but I have come to a problem and I can't seem to find the solution. I need to take an existing set of objects and an existing legacy database and use Hibernate for my ...

32. Table-per-subclass strategy    forum.hibernate.org

It has been suggested on this forum to use the table-per-subclass (TPS) strategy in my application design (see http://forum.hibernate.org/viewtopic.ph ... highlight= ). I have several questions about this strategy, for which I didn't find the answers in the Hibernate book: 1. TPS strategy performance may be unacceptable if there are multiple subclasses. However, sometimes the superclass table may contain a field, ...

33. Hibernate3 and table-per-subclass discriminator    forum.hibernate.org

hmm, I tried the last example on that link and I got this error: aused by: org.xml.sax.SAXParseException: Attribute "outer-join" must be declared for element type "join". I am using this DTD: Am I using the right DTD or the DTD is inconsistent? Thanks. Alec

34. is many to many mapping with subclasses supported?    forum.hibernate.org

Hibernate version: 2.1.6 I have a ServiceLevel abstract class with two subclasses : BaseServiceLevel and Accessorial. I have a ServiceGroup entity that has a many-to-many releationship with BaseServiceLevel instances *and* Accessorial instances. In the 'set' mappings for ServiceGroup, I specify two sets- one for BaseServiceLevel's and the other for Accessorial's however what I find is that on running, the ServiceGroup instance ...

35. JBossCache error when a joined-subclass is updated    forum.hibernate.org

Hi all, I am using JBossCache 1.2, and when I make two consecutive updates on a joined-subclass object, JBossCache logs an error message. It seems that with a joined-subclass object, the first update removes the object from the cache and then the second update logs the error that the object could not be found on the cache. The same doesn't happen ...

36. Hibernate3 table-per-subclass exception    forum.hibernate.org

I started using Hibernate3 and am getting the following exception: org.hibernate.exception.GenericJDBCException: could not load an entity: [data.Entity#88] Here is what I am trying to do. I have a Resource and Member classes, which extend the Entity class. Entity class contains entity_type column (which contains either "resource" and "member" strings), which I use as a discriminator in the element similar to ...

37. Mapping problem with subclasses...    forum.hibernate.org

Beginner Joined: Tue May 11, 2004 10:40 am Posts: 37 Location: Belgium Hibernate version: Latest version of Hibernate. I have the following 'uml' scheme: ---- //Root class. abstract class SyntaxComponent private String name; ---- //Subclass of SyntaxComponent class Rule extends SyntaxComponent private Operation op; ---- //Abstract Subclass of SyntaxComponent abstract class Term extends SyntaxComponent ---- //Abstract Subclass of SyntaxComponent abstract class ...

38. Master/detail with subclass in detail    forum.hibernate.org

BeanFondi has an association with BeanFondiEU that has two subclasses: BeanfondiE and BeanFondiU. They are mapped by Hibernate in followed way: BEANFONDI:

39. Dynamic class and subclasses    forum.hibernate.org

If by "Dynamic Class" you mean a dynamic components, then no. Actually, you can't use polymorphism at all with components in general, not just dynamic components, which is unfortunate. I'm constantly wanting to use a dynamic component in my classes. I've read posts that the Hibernate team wasn't aware of any good use cases for polymorphic components. I've got several!

40. Subclasses - Newbie question    forum.hibernate.org

Hibernate version:3 beta 1 All I currently have the following: public abstract class Party { ... } public abstract class Person extends Party{ ... } public class Employee extends Person { ... } These can all be mapped to a single DB table The problem I have is when I instantiate either a Person or a employee, when persisting to the ...

41. select-before-update with joined-subclass    forum.hibernate.org

42. Cannot subclass final class    forum.hibernate.org

[b]Hibernate version: 3.0a[/b] Just in case someone is as stupid as me. I got the following error message: 18.01.2005 11:43:45 ERROR - CGLIB Enhancement failed: de.ifbfag.crk.bl.cashflowgen.zusatzzahlung.conf.Bonus java.lang.IllegalArgumentException: Cannot subclass final class class de.ifbfag.crk.bl.cashflowgen.zusatzzahlung.conf.Bonus at net.sf.cglib.proxy.Enhancer.generateClass(Enhancer.java:438) at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:215) at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:368) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:280) at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:597) at org.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:76) at org.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:38) at org.hibernate.persister.AbstractEntityPersister.(AbstractEntityPersister.java:455) at org.hibernate.persister.BasicEntityPersister.(BasicEntityPersister.java:350) at org.hibernate.persister.SingleTableEntityPersister.(SingleTableEntityPersister.java:99) at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:44) at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:188) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:990) ...

43. Missing table reference in SQL (with joined-subclass)    forum.hibernate.org

Hi there, it seems that Hibernate generates a wrong SQL query (constructed from an HQL query) when I refer to a property of a mapped base class. My HQL query is this: Code: from Client c where 1=1 and lower(c.person.email.email) like ? The SQL displayed by Hibernate via show_sql is this: Code: Hibernate: select client0_.id as id, client0_.party_ref as party_ref from ...

44. table-per-subclass; 2 subclasses, an entity is both    forum.hibernate.org

We've run into a problem with the table-per-subclass strategy. We have the following simple hierarchy: External_Organization Vendor (extends External Organization) Manufacturer (extends External Organization) Some External Organizations might be a Vendor AND a Manufacturer. Hibernate doesn't seem to like this. We have created a table for each of these entities. Each table has as its key a column named ORG_ID. How ...

45. joined-subclass confusion    forum.hibernate.org

Hello, Can somebody please help me resolve this issue: Hibernate version: 2.1.5 Mapping documents: ...

46. Virtualization not available for Subclasses?    forum.hibernate.org

It would appear that Virtualization (aka filters) are not getting applied if you are using a subclass tag and load up objects based on your subclass. i.e. I have a Class called Cat which is a subclass of Animal. In Animal I have a filter condition where "age > 3". If I create a criteria based on Cat.class and execute a ...

47. Subclass of java.util.Collection in collections    forum.hibernate.org

How can I use a subclass of java.util.Collection in Hibernate associations ? For example, in a Customer class having an assocation with class Product via methods : [code]public ProductCollection getProducts() public void setProducts(ProductCollection products) [/code] I have to write an accessor class to convert a Collection coming from Hibernate into a ProductCollection and back. It works this way, but a lot ...

48. collections in union-subclass mapped class    forum.hibernate.org

49. Use DISTINCT with a subclass    forum.hibernate.org

50. joined-subclass inside subclass    forum.hibernate.org

I have read some topic about multitable mapping in this forum. I understand Hibernate3.0 gives the feature to solve the problem. Somehow, my problem is kind of different. I have Class B implements Interface A ---> Table X Class C extends Class B --- Table Y In the tables, I am using the primary key column as my discriminator column ...

51. HQL query using a property of a subclass    forum.hibernate.org

52. all database being retrieved on subclass while lazy="tr    forum.hibernate.org

Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message bernardsirius Post subject: all database being retrieved on subclass while lazy="tr Posted: Fri Feb 18, 2005 8:05 pm Newbie Joined: Mon Dec 27, 2004 10:23 am Posts: 7 Name and version of the database used: MySQL ...

53. table-per-subclass question    forum.hibernate.org

Hi all, I have a question on what happens with table per subclass mappings And i hope you can all help. What i need to do is simple, i need to have a class A and a Class B that extends A, simple enough, but what i need to happen is i need to be able to declare and use Class ...

54. Ordered collection of joined-subclass resulting in bad SQL    forum.hibernate.org

Pro Joined: Tue Aug 26, 2003 8:07 pm Posts: 229 Location: Brisbane, Australia Ok, CapturedDocument subclasses Document. DocumentBatch has a collection of CapturedDocuments. When we try to order the collection by a property of the superclass (Document), Hibernate generates SQL that looks for the superclass property on the subclass' table (see generated SQL below, it seems to be using the wrong ...

55. Native SQL query that returns joined-subclass    forum.hibernate.org

Newbie Joined: Thu Feb 24, 2005 11:20 am Posts: 2 Hi, I would appreciate all the help in regards to an issue I have when trying to execute a native SQL query that returns an instance of a joined-subclass mapping. Here's the details: 1. Using Hibernate 2.1.8 2. The mappings ...

56. Can my joined-subclass have its own primary key?    forum.hibernate.org

57. Can this be done - joined-subclass question?    forum.hibernate.org

Author Message cc_humbry Post subject: Can this be done - joined-subclass question? Posted: Fri Feb 25, 2005 8:48 am Newbie Joined: Wed Dec 15, 2004 10:38 am Posts: 5 Location: Maidstone, England Read the rules before posting! http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version:2.1 Mapping documents: Code:

58. Mapping where joined-subclass has its own primary key    forum.hibernate.org

Read the rules before posting! http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 2.1.8 Mapping documents: NONE Code between sessionFactory.openSession() and session.close(): NONE Full stack trace of any exception that occurs: NONE Name and version of the database you are using: DB2 UDB 8.2 The generated SQL (show_sql=true): NONE Debug level Hibernate log excerpt: NONE Hi all, I have a question about mapping and ...

59. Problem persisting locale specific subclasses    forum.hibernate.org

Hi, I'm trying to persist a variable subclass based on an interface. I'm getting Could not instantiate component with CGLIB: packagename.Mobile Any ideas? I have the following file structure: Subscriber.java - class containing component reference to Address interface. Subclass of User.java AddressFactory.java - factory creating addresses based on created string name, based on locale Address.java - interface containing component reference to ...

60. Trying to filter on joined subclass using Criteria API    forum.hibernate.org

Hi, I'm trying to build a query using the Criteria API that can filter results on a joined sub-class. To illustrate the problem let's say I've got a class "Group" with a unidirectional one-to-many relationship to a class "User", this class having a subclass "ForeignUser" containing a field "country". Using this schema, I want to retrieve all the external users - ...

61. joined-subclass please help    forum.hibernate.org

Hi i have 2 table one class ModeVO Code: ...

62. subclass and it's property    forum.hibernate.org

Hello. This is a fragment of my mapping documents: Code:

63. two joined subclass : one-to-one association    forum.hibernate.org

Hibernate version: 2.1.7c Mapping documents: Code: ...

64. HQL: query a subclass?    forum.hibernate.org

65. joined subclasses - theoreticat question    forum.hibernate.org

Please, give me an example. I tried to do it various ways. here You have example simple code : Code:

66. xdoclet joined-subclass not creating mapping in superclass.    forum.hibernate.org

Hi, I am new to Hibernate. This is more of a XDoclet issue than Hibernate issue. I have 3 classes 1. OIDObject.java : generates sequence ID. 2. Error.java extends OIDObject : Superclass 3. WorkRequestError extends Error : Subclass I am using "Table per Subclass". Sequence ID generation is working fine. Problem Description : When I put @hibernate.joined-subclass and @hibernate.joined-subclass-key tags in ...

67. WrongClassException -- problem with subclass query    forum.hibernate.org

hello, I'm going in circles with this class exception -- basically i'm trying to filter out items of a specifc class, using the discriminator value. but its really not working. i havea feeling i'm doing something wrong... thanks, sara =================================================== Hibernate version: 3.0beta4 (reverted when i hit the problem with subqueries in the rc) Mapping documents: Code: ...

68. HQL and Joined-Subclass interpretation problem    forum.hibernate.org

... ... ...

69. Bug in select-before-update for joined subclasses    forum.hibernate.org

Read the rules before posting! http://www.hibernate.org/ForumMailingli ... AskForHelp The generateConcreteSelectString() method in net.sf.hibernate.persister.NormalizedEntityPersister generates a sql statement which causes a sql exception: java.sql.SQLException: ORA-00936: missing expression. The mistake in the sql statement is in the "where and". This occurs whenever I do a select-before-update in a joined subclass (see the Fermenter subclass below) Hibernate version: 2.1.8 Mapping documents: (only relevant class ...

70. Inheritance - How to know if it's a super or subclass    forum.hibernate.org

Hello, I'm a new hibernate user. Every day I understand something new. My question now is: I'have implemented a superclass (for example Cat) and a subclass (for example DomesticCat that extends Cat). Everything runs perfectly, but... If I would like yo load a Cat but I don't know if it is Cat o DomesticCat, what can I do? If I load ...

71. union-subclass mapping in Hibernate3    forum.hibernate.org

72. Error using with joined-subclass    forum.hibernate.org

Read the rules before posting! http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version:3.0rc1 Mapping documents: Code:

73. SecondLevelCache not enabled when is    forum.hibernate.org

...

74. dynamically add mapping of the subclass    forum.hibernate.org

75. Joined Subclass    forum.hibernate.org

Newbie Joined: Tue Mar 29, 2005 10:20 pm Posts: 1 Hi : I seem to be having an error creating a joined sub class. Below is the mapping - I get a java.lang.ClassCastException exception .... When I look at the logs it looks like it is not setting the id at the sub class level. However in my code I explicitly ...

76. Many-to-Many error: Object not of specific subclass    forum.hibernate.org

Hibernate version: 3.0 Name and version of the database: Oracle 8i I have 2 classes A (with 2 sub-classes A1, A2) and B. There is a many-to-many relationship between these two classes represented by C Mapping of A: ------------ ... ...

77. Mapping a Hierarchy using Table per Subclass (PK!=FK)    forum.hibernate.org

Hi, I'm trying to create a mapping for a hierarchy that is modeled as follows in the domain model: A SubClass extends a SuperClass In the database this is modeled as follows: SUPERTABLE: SUPERTABLEID (PK) NAME (VARCHAR) SUBTABLE: SUBTABLEID (PK) DESCRIPTION (VARCHAR) SUPERTABLEID (FK) Now when mapping this with an joined-subclass in the supertable.hbm.xml file, all works fine when leaving out ...

78. Proxy use with Subclasses, trying to avoid extra overhead    forum.hibernate.org

Trying to figure out how to use Proxies - I've read all the information I can find but I'm still abit clueless. I get they are ways of lazy-loading so I don't have to instantiate my objects with every attribute (i.e. save sql calls). Here's the scenario I'm trying to optimize: I'm making a call to viewObject?id=5 where the id is ...

79. a subclass and its subclass -ing to the same ta    forum.hibernate.org

Beginner Joined: Thu Oct 16, 2003 7:30 am Posts: 21 Location: Brussels Read the rules before posting! http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.0 Mapping documents: S_TEST_01 ...

80. Q: joined Subclass and generated Id    forum.hibernate.org

Beginner Joined: Wed Feb 23, 2005 2:23 pm Posts: 21 Location: Pescara, italy Hibernate version: Hibernate 2.1.2 Name and version of the database you are using:MySql I have a class 'Gebaeude' and a Subclass 'Lagerhaus'. I have decided to use the table per Subclass strategy to reflect inheritence. If I create a Lagerhaus la = new Lagerhaus() and execute session.save(la) I ...

81. EnhancerByCGLIB ClassCastException with subclasses    forum.hibernate.org

I have a case where I have the following class structure: CourseRole extends UserRole Post contains a UserRole called 'creator' I do: Code: p.setCreator(my new Course Role) close hibernate load p system.out.println(p.getCReator()) cast p to CourseRole from UserRole. get a class cast exception. I know this isn't proper OO, and I won't be doing it outside of the test case, but ...

82. Customer PropetySetters and Joined Subclasses    forum.hibernate.org

I have this mapping:

83. Exception for joined subclass.    forum.hibernate.org

Newbie Joined: Fri Apr 15, 2005 11:09 am Posts: 2 I'm getting an exception for a joined subclass Hibernate version: 2.1.8 Mapping documents: error Muerto m = ...load(Muerto...., id); Ejemplar e = (Ejemplar) m; ------------>error if I load MUERTO, ...

85. Saving two different subclasses with one unique superclass    forum.hibernate.org

In the application I'm developing the user can add relations to the database. There are different kinds of relations, such as: Customer Distributor Besides the differences, there are a couple of things that are similair. That's why I created a structure like this: Code: +----------+ -->+ Relation + ...

86. nesting joined-subclass    forum.hibernate.org

First Class is a Person Class cointaining an id , first name last name Second class is the Employee Class which extends Person by adding an employee id Thirst class is an special kind of employee which brings a set of specialized properties. I map the Person Class to a table that contains an id and other fields The Employee to ...

87. SQL error getting objects declared by union-subclass    forum.hibernate.org

Author Message yuricake Post subject: SQL error getting objects declared by union-subclass Posted: Tue Apr 26, 2005 12:38 pm Newbie Joined: Wed Apr 06, 2005 12:30 am Posts: 7 A quick summary of the problem before all of the required elements are included: Base1 has some common fields on it and is abstract Super1 derives from Base1, is abstract, ...

88. could not resolve property of subclass that exists    forum.hibernate.org

Newbie Joined: Fri Apr 08, 2005 1:00 pm Posts: 2 Problem description: Here is my problem with total confusion, I can set properties on subclass( pk class for ClassB) of ClassB but why I can't set properties on ClassB itself, and the same issue for ClassC. I have working search page where I used to set properties of ClassA and it's ...

89. one-to-one use within joined-subclass - should it work?    forum.hibernate.org

Primary key associations don't need an extra table column; if two rows are related by the association then the two table rows share the same primary key value. So if you want two objects to be related by a primary key association, you must make sure that they are assigned the same identifier value!

90. joined-subclass and getting super/sub-class    forum.hibernate.org

Thanks, Vincent. If this is as designed, there really ought to be a way to instruct Hibernate to instantiate an instance of the base-class (i.e. the class being asked for) as opposed to the sub-class (i.e. the specialized class). I'd find it strange if this is not the case since creating the specialized instance is likely to have a greater cost. ...

91. Collection Mapping & Subclasses    forum.hibernate.org

Is it possible to map a collection of polymorphic objects when the foreign key exists only on the superclass (table-per-subclass)? I attempted to implement such a mapping earlier today, but found that things weren't as easy as I had envisioned when I started. I guess my real question is, "Must the column specified in reside in the table defined by ...

92. Howto count instances of several subclasses using one query?    forum.hibernate.org

Author Message aabeling Post subject: Howto count instances of several subclasses using one query? Posted: Mon May 09, 2005 4:16 am Beginner Joined: Fri Feb 11, 2005 12:03 pm Posts: 48 Location: Kiel, Germany Hi, I have an abstract class Account and three Subclasses of Account: RealAccount, AliasAccount and MailList. Mapping works fine. How can I select the count ...

93. How to set a 2nd discriminator for subclasses within a subcl    forum.hibernate.org

Hi Steve, perhaps it is because of my bad english that I can not spot my question to a clear point. So i try it again I checked the test stuff and hibernate in action. both could not provide an unswer to this: Hibernates 3.0.x Mapping DTD enables me to create a Mapping-File like this Code:

94. how to access parent's properties from joined-subclass    forum.hibernate.org

Hibernate version: 2.1.8 Mapping documents: I have successfully used HibernateSynchronizer to generate lots of my applications classes. ...

95. Mapping and subclassing with couple tables    forum.hibernate.org

Hibernate version:3.03 DB Schema PossibleBuildParam --- CpProfileParam -- Profile | | CpRequestParam -- Request ---------------- *There is also an association between Request and Profile, only forum shows it incorrect when I put it in, due to the spaces The PossibleBuildparam has an paramId, name, value, allowInRequest etc The CpProfileParam has paramId, profile, value, allowInRequest The CpRequestParam has paramId, request, value In ...

96. Why can't I cache joined-subclass'es?    forum.hibernate.org

97. WrongClassException on joined-subclass    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.0.2 Mapping documents: HI_VALUE NEXT_VALUE 100 ...

98. subclass without discriminator    forum.hibernate.org

Hi, we have an entity which have a subclass. The entity is persistent and the sublcass is not. Now we want the subclass also to be persisted. But in our case, no discriminator value exists to tell the difference between the entity and the subclass (the subclass is just a different 'view' of the entity) Is there some way to do ...

99. joined-subclass failing to recognize new object on parent    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.0 In this scenario I have 3 objects/tables: A Parent class - BusinessRelationship A joined-subclass - Client A collection on the parent of addresses. It seems that the primary cache in the session is not associating new addresses with the collection on the parent if the address is persisted ...

100. Subclass and One-to-One relationship    forum.hibernate.org

Hi, I am trying to persist the following objects in the listed tables. To specify in the .hbb.xml, How do I specify this? Eithe one Mapping XML or Two XML Mapping? If I use , Can I define the TradeTypeA class persistence mapping in a different xml file? Please help me out here. Thanks, Idhaya CREATE TABLE TradeHeader ( tradeId int ...