ClassCastException « Map « JPA Q&A





1. Creating Object from Hibernate Mapping    stackoverflow.com

If I have a mapping like this:

<class name="Users" table="users">
    <id column="id" name="id">
        <generator class="native"/>
    </id>
    ...

2. How to map a simple Hibernate join result to object with sub-objects?    stackoverflow.com

I am confused about how to query for a list of objects with sub-objects in it. I have two classes Execution and Order. And In Execution, I have the order object in ...

3. entity inheritance and ClassCastException    forum.hibernate.org

Hi. In my code I have inheritance structure as follows: Code: @Table(name = "TD_TASKS") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "DISCRIMINATOR", discriminatorType = DiscriminatorType.STRING) @DiscriminatorValue("") @ForceDiscriminator public abstract class TaskVO implements Serializable, Cloneable, EntityVO, TaskVOInterface { @Id @SequenceGenerator(name = "TD_TASKS_SEQ", sequenceName = "TD_TASKS_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "TD_TASKS_SEQ") ...

4. ClassCastException with Map and binary    forum.hibernate.org

Hi all, I have a Class HibernateDataEventAudit with a Map (HashMap) newData which contains String as key and Object (can't know which type at development time). So I have set the following mapping with Hibernate 2.1.1 : (PostgreSQL) I'm sure that at runtime, ...

5. Inheritance and Interface proxies cause ClassCastException    forum.hibernate.org

I've got a problem with using interface proxies together with inheritance (joined-subclasses). This problem is described in this thread http://forum.hibernate.org/viewtopic.php?t=927010. Simply, it causes that a CGLib proxy has a RANDOM interface. I'd like to ask, if anything has changed. Or if you still thing this is a correct behaviour. (Gavin: Quote: This is all correct behavior for interface proxies. Try using ...

6. ClassCastException with Integer Index in a Map    forum.hibernate.org

Newbie Joined: Wed Sep 01, 2004 3:02 pm Posts: 2 Location: Connecticut Hi all, Very new to Hibernate, and I've looked around the forums, but didn't see anything on this issue, so please excuse me if it's already been addressed elsewhere. I have a feeling that this may have something to do with the MS SQL Server rather than Hibernate, or ...

7. ClassCastException on n-n lazy/not lazy with inheritance    forum.hibernate.org

Hi, I'm having a weird ClassCastException here. I have a many-to-many relationship between Category and Product. I create a Software, subclass of Product. When I retrieve a Category and get its Products (which are actually instances of the Software class), I actually get the CGLib enhanced class for Product (and not Software). Hence my ClassCastException when I try to cast to ...

8. ClassCastException for StringType.. removed type on mappings    forum.hibernate.org

Hey there. I read that ClassCastException for StringType are likely mapping discrepencies, so I've triple-checked my mapping types against my POJOs. I even removed the types alltogether. Yet, I'm still lost with this ClassCastException. What am I missing? Thanks. Hibernate version: 3.0.5 & 3.1rc1 Mapping documents and POJOs: http://www.firestruck.com/temp/Patient.hbm.xml http://www.firestruck.com/temp/Address.hbm.xml http://www.firestruck.com/temp/Patient.java http://www.firestruck.com/temp/Address.java Full stack trace of any exception that occurs: [java] ...

9. ClassCastException when mapping a Custom Collection Type    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp I'm implementing an UserCollectionType for a custom collection that extends HashMap. With the log4j level set to 'debug' I get ClassCastException at org.hibernate.type.CollectionType.toLoggableString(CollectionType.java:152), when retrieving the graph. If log4j level is set to 'WARN' or 'INFO" it works fine. Any help? The classes are: public interface InfoMap extends Map { public ...





10. ClassCastException when using a many-to-one mapping    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.1 Mapping documents: PRG_IPT_WBS_METRICS SEQ_PRG_IPT_WBS_METRICS

11. ClassCastException with mapping    forum.hibernate.org

Newbie Joined: Wed Apr 15, 2009 3:44 am Posts: 1 Hello [b]Hibernate version:3.0---Annotation version:3.0 ----Database-Postgresql [b]My Database Tables are:-- List of relations Schema | Name | Type | Owner --------+---------+-------+---------- public | devices | table | postgres public | event | table | postgres public | host | table | postgres Table "public.devices" Column | Type | Modifiers ----------+---------+----------- deviceid | ...

12. ClassCastException at org.hibernate.property.MapAccessor$Map    forum.hibernate.org

Using hibernate distribution 3.3.2.GA (here's my config xml, mapping xml, POJO and save code) com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/swift root org.hibernate.dialect.MySQLDialect 1 100 100 0 10 100