polymorphism « Map « JPA Q&A





1. Hibernate polymorphism: instantiating the right class    stackoverflow.com

I'm new to hibernate, as you'll soon see. I apologize if this question has an easy answer, but I'm just not familiar enough with all of the terminology to find ...

2. Hibernate polymorphism    stackoverflow.com

This is a Hibnerate polymorphism question and a data model design question; they are intertwingled. I've used Hibernate in the past, and have enjoyed it, but sometimes I find it difficult to ...

3. queries in Hibernate polymorphism    stackoverflow.com

I'm relatively new to Hibernate and am trying to migrate a relatively simple existing database to something that I can use with Hibernate, and am looking for advice on how to ...

4. Does @AttributeOverride annotation breaks polymorphism?    stackoverflow.com

I need help with inheritance in JPA I will illustrate my problem with an example: Supose we have an Animal class and a Cat class.

@Entity
@Table(name = "animal")
@DiscriminatorColumn(name="animal_type",columnDefinition="Integer",length=11)
public class Animal implements Serializable{
   ...

5. How to define polymorphism in JPA    stackoverflow.com

there is a situation. For example, I am designing simple blog. There are articles and photographies. Users can add their comment to both of them. So when I write it in ...

6. JPA relations and polymorphism    stackoverflow.com

I have the following class structure (details are omitted for clarity): For example:

@Entity
class A{

@OneToMany
private List<B> b;

@OneToOne
private C c;


}

interface B {

}

@Entity
@Inheritance
abstract class Babstract implements B {

}

@Entity
@PrimaryKeyJoinColumn
class B1impl extends Babstract  {

}

@Entity
@PrimaryKeyJoinColumn
class B2Impl ...

7. How can I map this polymorphism in Hibernate, using XML, without creating extra parent tables?    stackoverflow.com

I'm trying to map a tree of POJOs in Hibernate so that I can (a) concisely use UUIDs for primary keys everywhere and (b) externally impose set-like relationships between otherwise unrelated ...

8. hibernate query on supertype returns me results from subtypes, How can I return only results from supertype?    stackoverflow.com

Is it possible to make an hibernate query only on supertype ? My supertype whom is called Conversation has its own hbm. Conversation is the supertype of Idea & Question which also have ...

9. How to perform a polymorphism explicit query on a Criteria query?    stackoverflow.com

I want to perform a criteria count query on my supertype Class which has its own HBM and not count the subclasses. The query would then be a "non-polymorphic" query. I tried by ...





10. Mapping Collection of Interfaces in NHibernate/Hibernate    stackoverflow.com

Say for example, I have the following:

public interface IPet
{
    long? Id { get; set; }
    string Name { get; set; }
}

public class Cat : IPet
{
 ...

11. JPA Criteria API: query property of subclass    stackoverflow.com

Bonjour! I have a class structure like this:

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class Article {
   private String aBaseProperty;
}

@Entity
public class Book extends Article {
   private String title;
}

@Entity
public class ...

12. Java Reference type with subclass uniqueness and polymorhism    stackoverflow.com

I have a general OO design question that stems from a Hibernate Model. Example payment - Base (SuperType)

@Entity
@Table(name = "PAYMENT")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn( name = "type", discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("BASE")

public class ...

13. hql and polymorphism    seamframework.org

hi everybody,i defined a hibernate entity with a polymorphic object property so the property's type is a base class and various object types can be assigned.Everything worked out fine since now, but now i want to perform an hql query with a join like:select objA from classA objA inner join fetch objA.prop objB ...now in the result objA.prop is always an ...

14. Polymorphism with JPA and Hibernate    coderanch.com

I'm using JPA for a project, and something has me stumped. Here's the scenario: I have an abstract class called Automobile: @Entity @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) @DiscriminatorColumn(name="TYPE", discriminatorType=DiscriminatorType.STRING,length=10) public abstract class Automobile implements Serializable { } There are two concrete classes that subclass Automobile: @Entity @DiscriminatorValue("Car") public class Car extends Automobile { } @Entity @DiscriminatorValue("Truck") public class Truck extends Automobile { } Using Hibernate's ...

15. Hibernate and polymorphism    coderanch.com

16. Polymorphism and relationships - JPA    coderanch.com

Hi everyone, I'd like to use polymorphism with relationship in a JPA enabled J2SE application. On one hand I've got the Customer and Supplier classes that both extends Partner. On the other hand, I've got CustomerOrder and SupplierOrder that both extends Order. I've simplified the example for clarity but the code snippets below should clarify what annotations have been used to ...





17. How to improve performance with polymorphism    forum.hibernate.org

18. creating implicit polymorphism    forum.hibernate.org

19. implicit polymorphism not supported for scroll() queries???    forum.hibernate.org

I have a class A mapping to table A, and subclass B and C of A mapping to view B and C. When B and C is in a different database than A, everything works fine. But when B and C are in the same database as A, I am getting the following error: Caused by: org.hibernate.QueryException: implicit polymorphism not supported ...

20. Can't make polymorphism to work    forum.hibernate.org

Hi everyone, I'm using Hibernate 3.3.1, MySql and JPA annotations. I've a problem when trying to implement a model that uses polymorphism. Here's the data model I'm trying to implement : Code: @Entity @Table(name = "baseFruit") @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "type", discriminatorType = DiscriminatorType.INTEGER) class BaseFruit { @Column(name = "type", nullable = false) ...

21. Polymorphism in hibernate inheritance model    forum.hibernate.org

Hello, let's assume that we have a certain situation where class A is parent for class B and class C. Inheritance strategy should be irrelevent. Is there any way to select only instances of class A without unnecessary joins/unions with children classes seen in hibernate-generated sql query? As I understand specifying explicit polymorphism on entities will cause selection of B or ...

22. Projection and polymorphism    forum.hibernate.org

24. Polymorphism question    forum.hibernate.org

Hi, suppose I have two classes, where one of them is a joined-subclass of the other. Is there any decent way to get only members of the superclass, but none of the subclass type with one query? (I've tried to play with polymorphism=explicit, but seems it doesn't help on this, queries retreiving the superclass type still return subclasses as well). tia, ...

25. joined-subclass and explicit polymorphism limitation    forum.hibernate.org

Hello, Is it possible to somehow use explicit polymorphism on a joined-subclass? I have a hierarchy with a base class Image and joined-subclasses InternalImage and ExternalImage (i.e. three tables). The InternalImage class (and table) has a binary with image data. I want to use the explicit polymorphism trick so I can update the other information in the InternalImage class without loading ...

26. What's the different between polymorphism=implicit|explicit?    forum.hibernate.org

It has to do with Hibernate's support for "polymorphic" queries. Say you have a class named Person mapped plus two others named Student and Instructor both of which extend from Person. Further, say you've mapped Student with explicit polymorphism and Instructor with implicit. In that case any queries looking for the Person class would return back not only all Person objects ...

27. Explicit Polymorphism with not null discriminator    forum.hibernate.org

It is possible to use a foreign key as descriminator. Only the explicit polymorphism does not work right. I have looked into the source (WhereParser) and the exception is thrown if the discriminator is null or not null. But I do not understand why it is not possible to build such a SQL query. Instead of the running query "where my_table.fk ...

28. polymorphism    forum.hibernate.org

I have class NEMgmtInfoC which extends NEMgmtInfo. In the mapping NEMgmtInfo has polymorphism=implicit. The following code throws ClassCastExeption on the line in bold: Code: public NEMgmtInfo[] getAllDevices() throws DAOException { Query q = null; List newList = null; try { ...

29. Search and Polymorphism    forum.hibernate.org

Beginner Joined: Tue Nov 25, 2003 11:55 am Posts: 23 Mapping of superclass X: ...

30. Polymorphism and proxy problem    forum.hibernate.org

Page 1 of 1 [ 2 posts ] Previous topic | Next topic Author Message thaenel Post subject: Polymorphism and proxy problem Posted: Mon Apr 05, 2004 11:45 am Newbie Joined: Wed Dec 10, 2003 8:40 pm Posts: 9 Hi, I'm experiencing some strange behavior with polymorphism and proxies. We have ...

31. Mixing Polymorphism Strategies    forum.hibernate.org

I have the following class hierarchy. "User", "Administrator", and "Representative" are all subclasses of "UserEntity". Since the 2 of these 3 subclasses have a reasonable number of properties that are unique to them, I declare these in hibernate using joined subclasses. No problem here. Now though, I want to subclass "User" a bit more, but for these 2 sub-subclasses, I want ...

32. Implicit and explicit polymorphism at runtime    forum.hibernate.org

Hello, I would like to know if there is any possibility to change the polymorphic behaviour of queries at runtime. To be more explicit, can I specify on a query that it has explicit or implicit polymorphism ? If it is not possible, how could I at some moment load only the properties of a root class (and instantiate this class), ...

33. How many levels of inheritance allowed with polymorphism?    forum.hibernate.org

Emmanuel, Could I ask you to elaborate? Is 2 the maximum level allowed or are you saying in my point 2, no mixing is allowed? I know one can't mix "table-per-hierarchy" with "table per subclass", but documentation suggests you can mix table-per-concrete-class with another strategy: " Since the subclasses(..for table-per-concrete-class strategy..) are each mapped in their own element (and since ...

34. Querying unmapped interfaces via implicit polymorphism    forum.hibernate.org

Consider the following example of 'table per subclass' inheritance mapping: Code: ... ...

35. polymorphism question    forum.hibernate.org

36. collection filter and polymorphism    forum.hibernate.org

I am using hibernate-2.1 with joined-subclass mapping I have a base class EmployeeAttributes{ int attributesId int dateId; } and 2 derived classes EmpAttType1{ PensionAtt penAtt; } and EmpAttType2. Class Employee contains a collection of EmployeeAttributes (of type EmpAtt1 / EmpAtt2 ). I am trying to use a collection filter to fetch attributes for a given dateId session.createFilter(employee.getEmployeeAttributes(),"where this.dateId = " + ...

38. Is there a way to turn off polymorphism?    forum.hibernate.org

Hello All, I have a database with a good number of joined subclasses, which works great for the business logic where the polymorphic behavior is truly desired. However, there is also a number if cases where we are only interested in the information from the base class but we still have to incur the overhead of all the outer joins in ...

39. HQL and polymorphism    forum.hibernate.org

In Hibernate reference chapter 10.6: a query like " from eg.Cat as cat " returns not only Cat , it returns also subclasses of Cat. and : http://forum.hibernate.org/viewtopic.ph ... hism+query How to use these subclasses that are returned base on polymorphism ? If type cast cannot be used in HQL. There must be a way to use them, I will like ...

40. Equals Proxies and Polymorphism    forum.hibernate.org

Just want to have some clear ideas on proxies and polymorphic classes. It seems there is some problem using proxies with polymorphic class. If I load a base class proxy, I cannot cast it to the subclass even if the underlying instance is an instance of the subclass. In my case, this breaks my equals method because I do an instanceof ...

41. Help: one-to-many polymorphism question    forum.hibernate.org

42. Possible extention: 'polymorphism' property for 'subclass'?    forum.hibernate.org

Halo, I want to know, if it possible and if it make sense to extend the attributes of the 'subclass' or 'joined-subclass' with 'polymorphism'-property = "implicit" or "explicit"? Thus it will be possible to control the selection of complicated class hierarchies, declared in a single or joined table. The 'polymorphism' property is now available only for "classes" with class per table ...

43. Polymorphism problem! Help...    forum.hibernate.org

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

44. Collections and polymorphism    forum.hibernate.org

Author Message jsuchar Post subject: Collections and polymorphism Posted: Thu Apr 14, 2005 1:27 pm Newbie Joined: Wed Sep 17, 2003 4:20 pm Posts: 3 I'm having a bit of trouble with getting a mapping to work properly. I have three classes TemplateNode, ProductBranch, and IndexLeaf. TemplateNode is abstract. ProductBranch and IndexLeaf are both concrete subclasses of TemplateNode. ProductBranch ...

45. Polymorphism and one-to-one relationships    forum.hibernate.org

Hi, I have the following problem: I have the Class1 with a set to Class2 but this class is mapped polymorphically (has two subclasses SubClass1 and SubClass2). Now, SubClass1 has a one-to-one relationship to Class3. I am having problems retrieving Class1->Class2. I am trying to do it with a Criteria query that looks like: Criteria criteria = session.createCriteria(Class1); criteria.setFetchMode("Class2", FetchMode.EAGER); criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTRY); ...

46. HQL queries and polymorphism    forum.hibernate.org

Hi, I am running into a problem when using HQL (or Criteria API) with Hibernate 3, I've been reading some of the posts but I am not sure yet if it's possible to do what I want. The question is, given the next mapping: Code: ...

47. Implicit polymorphism still requires mapping for interface    forum.hibernate.org

Author Message freemant Post subject: Implicit polymorphism still requires mapping for interface Posted: Mon Jun 13, 2005 4:13 am Newbie Joined: Mon Jan 17, 2005 5:43 am Posts: 13 Location: Macau Hi, I have an interface Foo1 that is implemented by two concrete classes Foo1Child1 and Foo1Child2. I'd like to use implicit polymorphism. According to the doc I don't ...

48. Newbie: Design / Polymorphism    forum.hibernate.org

Hello, Well I am currently in the process in designing an application that will be using the following dataschema : http://www.grosslers.com/dbschema4.jpg (A product can have many suppliers in case somebody wants to know why there is a link between SupplierProducts and OrderProducts) Anyway, I am working my way through Hibernate in Action, and one of the intresting things that was mentioned ...

49. XML mapping and polymorphism    forum.hibernate.org

I'm trying to map two concrete classes with an abstract base class, and be able to bulk load from XML. The issue I'm hitting is that my XML has different attributes for the item id, and there appears to be no way to specify this in my mapping document using either union-subclass or joined-subclass Hibernate version: Hibernate 3 production version. Mapping ...

50. polymorphism, mapping and HQL    forum.hibernate.org

Hibernate version: 3.0.5 I would like to have "mapped" polymorphism AND explicit polymorphism, but after much research, can not figure out how to do this, or if it is possible. I want "mapped" polymorphism for polymorphic associations, for updates. I do not want implicit polymorphism for polymorphic queries, because I have a superclass and 70+ immediate subclasses, so polymorphic queries would ...

51. inheritance: table per concrete class using polymorphism    forum.hibernate.org

I am trying to map an inheritance relationship using table per concrete class, using implicit polymorphism. I have been trying to follow the example in the documentation but it is very unclear. I have two concrete classes: car and bicycle that need to implement the interface vehicle. The interface vehicle has the common properties: id, and color. My mappings look like ...

52. polymorphism="explicit"    forum.hibernate.org

How does polymorphism="explicit" work? Does this enable only base class loading and instantiation? If I have Class A { } Class B extends A { } And when I set explicit polymorphism If I use A.class with Criteria, I am getting instnace of B. Is there a way to get only instance ...

53. Polymorphism in the same table.    forum.hibernate.org

I know that this might sound strange but due to constraints on the DB this is the way it must be. What we are trying to do is persist information from an objects state to the DB. This basically involves the state pattern. For example we have a DoorState which is an interface. This DoorState is implemented by two concrete states ...

54. HELP NEEDED: Dynamic Models (and Polymorphism)    forum.hibernate.org

Hello, we want to use Hibernate in our project, but we have the need, that we just want to change the mapping-xml-file to add new attributes to database tables on the fly. We don't want to add a Java Bean each time, so that we have to deploy the software every time to the users. So I came along the dynamic ...

55. criteria and polymorphism    forum.hibernate.org

Hello, I have a ClassA associated (many-to-one : "link" property) with ClassB which is derived in ClassC and ClassD I would like to write a Criteria Query on the ClassA, and I want that the associated class be an instance of a particular class. Something like session.cretaeCriteria(ClassA.class).add(Restrictions.instanceOf("link", ClassC.class)) Of course the "instanceOf" restrictions doesn't exist but is there a way to ...

56. Mapping with many-to-any and implicit polymorphism?    forum.hibernate.org

Hello - I'm using Hibernate3.1rc2. I have a java class hierarchy that is quite deep, where everything is inherited through a single entity class :- class Entity class NamedEntity extends Entity class SoftEntity extends NamedEntity class SoftProperty extends NamedEntity class Component extends NamedEntity class XmlData extends Component I use table-per-hierarchy mapping (in general), but I don't want 'Entity' to be the ...

57. Polymorphism Query    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 2.1 Mapping documents: Code between sessionFactory.openSession() and session.close(): Full stack trace of any exception that occurs: Name and version of the database you are using: The generated SQL (show_sql=true): Debug level Hibernate log excerpt: I have a question reguarding an issue that was posted back in January 2004. Below ...

59. Nested collections and polymorphism problem    forum.hibernate.org

I have a situation where I want to return an object based on a child of a child with certain property(s). My model looks like this: Container ContainerVersion ContentElement ContentElement can then be subclassed (joined strategy) and I want to query based on the property of a subclass, ie: Code: public class TextElement extends ContentElement { public ...

60. ClassCastException with inheritance + implicit polymorphism    forum.hibernate.org

Newbie Joined: Mon Jan 09, 2006 10:43 am Posts: 3 Location: Brussels, Belgium Hi there, Can someone please explain me the following. I'm creating a Hibernate 3.1 java project with 2 mapped classes, Child and Parent. Child derives from Parent. Parent derives from GrandPa, an abstract base class. The two classes map to respective tables called child and parent, on a ...

61. Implicit Polymorphism Issues    forum.hibernate.org

I have an object that I've loaded, and one of its properties is an OrgUnit. OrgUnit is a parent class to Organization. This particular object is an Organization, or it least it seems to be in the database. I've even run the query and checked the results, and the subclass properties are all loaded correctly. Yet, for some reason, if I ...

63. Conditional Polymorphism - mapping question    forum.hibernate.org

This is a mapping question. I have a two objects that get associated to each other via one of two possible tables. So, for instance, object A has a reference to object B via table X or via table Y. See the following picture: A-----X------B or A-----Y------B The property on A and on B is the same in both cases. The ...

65. xml mapping+polymorphism    forum.hibernate.org

Hi! I think the Xml mapping feature of hibernate is not fully implemented. It seems there is no support for writing polimorphic collections to xml. The node names are always the superclass node name, no matter they are actually subclasses. However the node content shows the real subclass properties, as xml elements. Is there a solution to make it work, or ...

66. criteria: polymorphism and association OR-ing questions    forum.hibernate.org

Newbie Joined: Fri Aug 25, 2006 10:18 am Posts: 8 Location: England Hibernate version:hibernate-3.1 I want to use Query by Criteria for all of my queries but I cannot figure out how to do a couple of things which I believe will be doable. I have spent a considerable amount of time reading the Hibernate books/docs/forums without being able to suss ...

67. about Table per concrete class, using implicit polymorphism    forum.hibernate.org

Hibernate version: 3.2 Name and version of the database you are using:Mysql 5.0.22 classes: Company.java Employee.java(has tow subclasses) | |--HourlyEmployee.java | | |--SalariedEmployee.java The relationship between Company.java and Employee.java is one-to-many I want to mapping them by the strategy of Table per concrete class, using implicit polymorphism Employee.hbm.xml Code:

68. mapping problem with polymorphism    forum.hibernate.org

Hi, I have one class (CI) which has 2 many-to-many associations. The associations are with 2 subclasses (Factor, Status) of an abstract class (Definition). The Definition hierarchy is mapped TABLE_PER_CLASS. On the CI-side, it seemed pretty easy, I just declare the 2 collections: Code: @Entity @Table(name="CIS") public class CI extends Id { private Collection statuses; ...

69. Polymorphism question (please help)    forum.hibernate.org

Is there any way to map this reference using multiple database columns? The discriminator column + "any" mapping means we would have to give up referential integrity on that column. When we have a small number of possible subclasses of the interface, we'd like to map the association with two (or three) explicit foreign key relationships (only one of which would ...

70. difference between explicit and implicit polymorphism    forum.hibernate.org

Hi, Can anyone explain me the difference between explicit and implicit polymorphism? Hibernate tutorial has mentioned the difference as - Implicit polymorphism means that instances of the class will be returned by a query that names any superclass or implemented interface or the class and that instances of any subclass of the class will be returned by a query that names ...

72. @Entity(polymorphism=PolymorphismType.EXPLICIT)    forum.hibernate.org

I am trying to exclude a subclass from Hibernate's polymorphic queries. I have an abstract Content class mapped with @MappedSuperclass @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) I have a File class which extends Content and a FileRevision class which extends File. FileRevision is a separate table that holds all revisions that have been made to a File. We also have the same setup for ...

73. Difference between implicit and explict polymorphism    forum.hibernate.org

... ...

74. Polymorphism doesn't run    forum.hibernate.org

Hi all, I'm trying to run polymorphism with Hibernate and it doesn't run. I've two tables: QUESTION (with id, name and question_type_id) and QUESTION_TYPE (with id and name). Question has a foerign key to QUESTION. For one QUESTION_TYPE. named "Multivaluated", I want to define a MultivaluatedQuestion class which includes a set of other objects of class Possibilities. I'm defining the polymorphism ...

75. Disable implicit polymorphism    forum.hibernate.org

Hi all. I have two classes, B extends A. It was done like that because they have a lot of common fields, but the objects aren'r really in a hierarchy. Now, when I issue a query "from A" I get objects of both A and B class. Is it possible to disable this, and get only the object of class A? ...

76. polymorphism and many-to-one    forum.hibernate.org

Author Message matti Post subject: polymorphism and many-to-one Posted: Mon Sep 10, 2007 12:03 pm Newbie Joined: Mon Sep 10, 2007 11:49 am Posts: 1 Hibernate version:3.2.5.ga Hi I'm trying to get a many-to-one mapping to work with a simple class hierachy Here's my little testcase: Code: public class EventTest extends TestCase { ...

77. Polymorphism question    forum.hibernate.org

I tried your suggestion but to no avail. I annotated class B as having polymorphism type explicit but it had no effect. I have now tried the following combinations: 1. class A = polymorphism.explicit, class B is none 2. class A = polymorphic.explicit, class B = polymorphism.explicit 3. class A = none, class B = polymorphism.explicit No combination has the desired ...

78. Polymorphism and self-reference    forum.hibernate.org

Hello everybody, I am trying to study how to use polymorphism and self-referencing. To make things clearer let's say we have a Context generic class (abstract) with several concrete implementations that reference a Context father. I would like to map these relations in Hibernate and my idea is to use polymorphism. My guess is that I think I can handle that ...

79. polymorphism=explicit with joined-subclass    forum.hibernate.org

Hello I have searched in the forum and I have seen often this question but not explicitly any sure answer. Does the polymorphism="explicit" class attribute work with joined-subclass. I have made a test and it does not seem to work: I have created a mapping with a class A and a joined subclass B I have filled my database with a ...

80. polymorphism mapping with many-to-many    forum.hibernate.org

serie ...

82. More than 30 joins in one query due to polymorphism    forum.hibernate.org

I have the following class hierarchy: Class AAA contains reference to BBB (named - bbb) Class AAA2 inherits class AAA (consequently - has this reference too) Classes BBB2,BBB3,BBB4,BBB5,BBB6 inherit BBB. However, in our application - class AAA2 can only have reference to BBB6. When calling find by id on AAA2 instance - the query generated by hibernate has more than 5 ...

83. Interfaces and Implicit Polymorphism    forum.hibernate.org

Hibernate version: 3.2.0.cr4 Name and version of the database you are using: HSQLDB 1.8 This is related to a post made by another user here: http://forum.hibernate.org/viewtopic.php?t=981404&highlight= Coding to interfaces, I have the following (a silly example, but the real example's more complex): Code: public interface SupportsTermination { void setTermDate(Date date); Date getTermDate(); } public class ...

84. Implicit Polymorphism    forum.hibernate.org

Hello All, I am having somewhat of an interesting problem. I am using a table per subclass mapping strategy, and therefore, I have a few classes that are persisted using implicit polymorphism. Unfortunately, I have some mappings that reference a few of these classes that do not have mappings because they are implicily persisted by their subclasses. Can someone tell me ...

85. Inner classes, polymorphism and frameworks    forum.hibernate.org

Hi ! Looking for mappings about inner classes, both static and a non static, I have only found questions related to static inner classes. Is it possible to map non static inner classes? I'm working with frameworks and as you know, in this context is very common to use a lot of nested classes with inheritance among them and in some ...

86. Polymorphism,session.get and "not of the specified subc    forum.hibernate.org

Hibernate version: 3.2.6 GA Name and version of the database you are using: SQL Server 2005 Imagine these two hypothetical class hierarchies... Code: Automobile | |-----------| Car Truck ...

87. Hibernate mappy for polymorphism model design    forum.hibernate.org

We have a legacy application that currently uses object-oriented database and we hope that we can switch to ORDB. The model design is highly object centric with layers of inheritance. The follow is one simplified example of the data model. public abstract class A { // As properties List exampleList = new ArrayList(); } public class AA extends ...

88. Model versioning, polymorphism and backwards compatibility    forum.hibernate.org

Newbie Joined: Fri Jul 18, 2008 7:43 pm Posts: 1 Hi All, I ran into a problem in the versioning of the Canonical Data Model (CDM) with Hibernate where backwards compatibility for multiple versions is a must. I am using JBoss 4.2.2 When we add functionality to a CDM descendent we invoke the default behavior of Hibernate and we need a ...

89. Polymorphism query returns to many results    forum.hibernate.org

Dude, can you explain better? I simulated your code here, and it works as expected: I tested with Hibernate 3.2.3ga, which is the same you used. I could not identity whether you used pure JTA or Hibernate Annotations + Hibernate Entity Manager + Hibernate Core. Which version of Hibernate Entity Manager are you using? In my test, I used only JTA, ...

90. Implicit Polymorphism    forum.hibernate.org

91. Question about many-to-one relation and polymorphism    forum.hibernate.org

Hi everyone, I'm using the latest hibernate version (=3.3.0 SP1), PostgreSQL (=8.2.4) and Spring (=2.5.5). The problem that stresses me is about a many-to-one relation that points to a entity that has a inheritance mapping: Code: public ...

92. Inheritance and Polymorphism problem    forum.hibernate.org

Hibernate version: 3 Hi, I'm new to Hibernate and have a question around inheritance. I've a base Java abstract class called User. Three classes extend from this but don't contain any additional data themselves, just different methods. All 3 are stored in a table in the database called User. Is it possible to create one mapping file for User to cover ...

93. Polymorphism the other way round    forum.hibernate.org

94. Polymorphism the other way round    forum.hibernate.org

95. Polymorphism (kind of)    forum.hibernate.org

I have a Single table per class hierarchy mapping (single table). I have an abstract base with two subclasses. Basically I want to execute a polymorphic query - meaning I want a query that returns a list of the base class. Problem is that I have a different "where clauses" for every subclass and the where clauses are based on properties ...

96. Implicit polymorphism    forum.hibernate.org

97. Inheritance "Table per subclasses" and java polymorphism    forum.hibernate.org

Using Hibernate 3, i tried to use inheritance "Table per subclasses" with discriminant as documentation show. This done, i never get correct polymorphism using many-to-one relation or load method based on mother class ! returned instances was only mother class instances !! May be i was wrong, but i can't see the usefullness of inheritance if it's not polymorphic at object ...

98. Hibernate Question on Inheritance/Polymorphism    forums.oracle.com

Hi, Not too sure if this is the correct forum but perhaps someone can help me with this Hibernate query. Class A is a base abstract class. Classes B, C and D extend from this abstract class adding different behaviour (methods) but no new data. The data for all 3 subclasses is stored in the same table. Is it necessary to ...