class « Annotation « JPA Q&A

1. Do I need elements in persistence.xml?

I have very simple persistance.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
    xmlns="" xmlns:xsi=""

    <persistence-unit name="eventractor" transaction-type="RESOURCE_LOCAL">

2. implementing dynamic class with using hibernate annotation

I want to implement a class which its fields could change (add new fields) through time. The problem is that I want to give my client this ability to do this ...

3. why my JPA annotated classes are not discovered implicitly?

My persistence.xml looks like:

  <persistence-unit name="test">
      <property name="hibernate.archive.autodetection" value="true" />

4. hibernate annotations same class refference

I'm in need a help if hibernate annotation, when I have a table with same parent id. Like this example

CREATE TABLE `server` (
  `server` int(11) DEFAULT NULL,
  `name` varchar(20) DEFAULT ...

5. what is "catalog" used in hibernate annotated class

in java class i have seen

@Table(name="user" , catalog="users"
for what purpose it is used

6. Can I specify a directory to add all JPA annotated classes to Hibernate configuration?

Hello, I am learning Hibernate and JPA Annotation. The following is what I use to make Hibernate be aware of JPA-annotated classes: ...... config.addAnnotatedClass(Thing.class); config.addAnnotatedClass(Fracture.class); config.addAnnotatedClass(Interest.class); config.addAnnotatedClass(Ancestor.class); config.addAnnotatedClass(Parent.class); ...... It is very tedious to add every class like the above. Is there any way I can use to specify all JPA-annotated classes in a directory? Thanks for your help!

8. Problem configuring after adding annotated class

I get a ClassNotFoundException when I try to configure after adding an annotated class from a jar that is not on the classpath. I am able to create the Class object from the class file in this external jar (meaning it isn't on the runtime classpath). I use this object as the parameter call to .addAnnotatedClass() The configuration fails with a ...

9. Need help - annotated classes not working in my deployed app

Newbie Joined: Fri Oct 17, 2003 11:31 am Posts: 19 I'm having an interesting problem show up when I attempt to use my Annotated classes in a deployed web application. Here is the scenario : 1 - I deploy my web application (in a .war file). My persistence unit is setup in my persistence.xml file as a JTA datasource. The ...

10. How to get method name by reading annotated classes

Hibernate Tools version:HibernateTools 3.2.0-beta9a Hi all, I am trying to write my own template for code generation by reading annotated classes. I am able to create but I just could not get the method name defined in an entity. I have a user table and a buyerrating table. rating table has two foreigns to user table. I just need to get ...

11. An Annotated Class Finder for Hibernate

12. Static nested class with Annotations?

13. Using annotated classes elsewhere in code

Hi all - I realize this is probably going to either sound really stupid or naive (or both) :) But, if I have an existing inheritance hierarchy in my application and I annotate this hierarchy to use the single table method... Can or (will) the existing hierarchy be able to operate as it previously did? Meaning I have a factory that ...

14. Looking for Annotations Despite exclude-unlisted-classes

Newbie Joined: Fri Feb 27, 2009 6:50 pm Posts: 1 Hi, everyone. I am converting from TOPLink Essentials to Hibernate 3.4, both using JPA, all inside of Spring 2.5, inside of Tomcat 6, running against MySQL 5. My application currently functions with TOPLink. To convert to Hibernate, I updated the files below. I'm not using any annotations, only the orm.xml for ...

15. Annotated classes in other project