Annotation 1 « Annotation « JPA Q&A

1. Another JPA Question

I have this code:

@PersistenceContext(name="persistence/monkey", unitName="deltaflow-pu")
public class GahBean implements GahRemote {
But when I use this:
 InitialContext ic = new InitialContext();
 System.out.println("Pissing me off * " + ic.lookup("java:comp/env/persistent/monkey"));
 Iterator e = ic.getEnvironment().values().iterator();
 while ...

2. How to use Hibernate @Any-related annotations?

Could someone explain to me how Any-related annotations (@Any, @AnyMetaDef, @AnyMetaDefs and @ManyToAny) work in practice. I have a hard time finding any useful documentation (JavaDoc alone isn't very helpful) about ...

3. Hibernate Annotation Placement Question

I've got what I think is a simple question. I've seen examples both ways. The question is - "why can't I place my annotations on the field?". Let ...

4. Hibernate annotations, autoincrement related

i am using hibernate annotations, at the back end i am using Postgres SQL 8.3. So, i don't know how to apply sequence in annotations of my Class. Plz provide related help ...

5. Hibernate (with annotations) - how to get started

I'm trying to get started with hibernate, but I can't find any tutorials I understand. I'm trying to create a simple app to get started, but I've really no idea where to ...

6. Does JasperReports/iReport work with Hibernate annotations?

I'd like to integrate existing application with JasperReports. However, when creating report with iReport the wizard is asking me for hibernate.hbm.xml. Since I'm using annotations I simply don't have one. Does ...

7. A question on @IdClass JPA Annotation

Heres a composite primary key for one of my entities.

public class GroupMembershipPK implements Serializable{

    private static final long serialVersionUID = 7816433876820743311L;

    private User user;

8. what are annotations in hibernate?

briefly, can someone tell me what an annotation is in hiberate? (java) is it a way to quickly map entities to tables?

9. Annotations of Annotations in Java 5/6

I am setting up Hibernate Caching and want to cache certain entities in different regions. For example, some entities can be "stale" for up to 5 minutes, some for an hour, ...

10. Yet another Hibernate question

My application is trying to use Hibernate annotations. I've gotten the 3.5.0 version of Hibernate installed, but when I try to load my app I get the following exception:

junit.framework.AssertionFailedError: Exception in ...

11. Persisting large files with Hibernate Annotations

I am using Hibernate Annotations for the first time in my web application. In my bean, what type what annotations should I use to persist files uploaded by users?

12. Annotations: methods vs variables

I was always sure (don't know why) that it's better to add annotations to variables, but while browsing the Hibernate doc I noticed they tend to annotate the ...

13. How-to dynamically fill a annotation

Sadly, I forgot to take the code from work with me today. But maybe this little example will clarify things. I use hibernate to map a bean to a table. Example:

import javax.persistence.column;
String columnameA;
public ...

14. Hibernate not JPA compliant regarding @Access?

According to my JPA 2.0 book (and online documentation), I should be able to mix field and property access within a single entity or entity hierarchy. The annotation of

15. Can annotation be added to decelerations

Can we add annotations to the decelerations instead to the getter methods. I'm used to this

   public Long getPartId() {
   return partId;
Can we use it like ...

16. Where to put hibernate annotations?

Where do i put my hibernate annotations? Is it the line above my instance variable? Or before the getter? Or before the setter? Or doesn't it really matter? Thanks a lot

17. Hibernate usage in a Servlet environment

I'm trying to create a domain object that contains objects in a read-only fashion but be able to modify which objects it points to. So in the example below I would like ...

18. Hibernate Annotations and SQL Server

I'm using Hibernate Annotations and trying to save an object. But when saving object I get:

Cannot insert the value NULL into column 'status'
The thing is that in my SQL Server ...

19. question about hibernate annotations

i have 2 entities: User and Role i have one class Userrole that will contain a composite key between user and role. now Userrole will not contain userId and roleId.. but the object ...

20. Hibernate with JPA annotation problem - lazy object

I have a USER table associated with many other tables, in general, star topology. Like this:

@Table(name = "user")
public class User implements Serializable {
    private static final long serialVersionUID ...

21. Hibernate Views using Annotations

Learned that it is possible to write a SELECT where each row can be effectively mapped to an object: Elegant ways to handle database views on hibernate entities? However, all answers use ...

22. Hibernate annotations using @PrimaryKeyJoinColumn

I am using hibernate annotations in my application. But I am getting one problem.

class A

@Table(name = DBConstants.T_A )
public class A {

    @Column(name = "id")

23. Calculating and storing precomputed average with Hibernate

Say I have a set of products and each product has a set of reviews. Each review has a score. I will need the average of the scores much more often ...

24. Understanding Annotation Processing in Java

Can someone describe the use of annotation processing?
My last attempt to understand annotations was unsuccessful. Previously I posted this question but couldn't get a satisfactory answer.
I went through many online tutorials ...

25. Hibernate: Issue with OnDelete Annotation

Hello I have the following two entities

public class DocumentCollection {
  private Long id;
@OnDelete(action = OnDeleteAction.CASCADE)
  private Set<Document> documents;
public class Document {

26. Hibernate one to many with annotations

Hi guy's i'm very new to hibernate and i have to use annotations also.I have two POJO classes one is having the fields id1,description in which id is the primary key ...

27. Does @Loader work correctly on annotations (using JPA)?

This is a somewhat contrived example meant to show a point. Here are two entity classes linked by a relationship and a named query:

@NamedNativeQuery(name = "loadFoo",

28. Where can I get Hibernate Annotations from?

I have just started reading a Hibernate book and it says go to and download both HibernateCore and Hibernate Annotations ..well I am at the website and cannot find Hibernate ...

29. Annotations Hibernate 3.5

The below annotation works when applying it to the field: @OneToMany(targetEntity=TestMany.class, cascade=CascadeType.ALL, fetch=FetchType.EAGER) ...

30. Link to Hibernate Annotation download

I wanted to download the Hibernate Annotation Module at the hibernate website but I cant seem to find where the jar files are located. I only see below links Hibernate Download ...</p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>31. <a href=''>JPA Annotation issue</a><span class='articleProductElementHost'></span></h3><p class='articleProductElementParagraph'>I have a Table A , Table AB , TABLE B , Table AB has foreign key references to Table A and Table B. There is a One to One relation ...</p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>32. <a href=''>Hibernate annotation many-to-one issue</a><span class='articleProductElementHost'></span></h3><p class='articleProductElementParagraph'>I have some issue with save object with one to many relationship. In my problem One UserGrop has many UserPermissions. Forthat relation ship I have create my domain class like this:

@Table(name ...</p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>33. <a href=''>Hibernate annotation</a><span class='articleProductElementHost'></span></h3><p class='articleProductElementParagraph'>Should we use @org.hibernate.annotations.Entity instead of @javax.persistence.Entity in Hibernate based applications?

Or is there no such rule?
 </p></div></td></tr><tr><td><div class='articleProductElement'><h3 class='articleProductElementTitle'>34. <a href=''>What use in place of Annotations Configuration in Hibernate?</a><span class='articleProductElementHost'></span></h3><p class='articleProductElementParagraph'>I used <code>AnnotationConfiguration</code> before but now is deprecated

<pre><code>AnnotationConfiguration cfg = new AnnotationConfiguration();
factory = cfg.buildSessionFactory();

So now it's recommended to use <code>Configuration</code> insted, but still get some error:
<img src=. How build a session ...

35. Hibernate annotations double[]

What is the correct annotation to persist a double[] in hibernate? e.g. private double[] myData; Thanks.

36. is it possible to skip presisting certain instance of object via annotation based on some condition?

The title is a bit of mouthful Let's say we have a collection of values object (say quantity of some goods in stock). When I call

I want it to automatically skip ...

37. Well known JSR-269 ("Pluggable Annotation Processing API") users besides JPA 2.0?

The JSR 269 - "Pluggable Annotation Processing API" - has been released 2006. Since then the only well-known use of this API has been the metamodel generation of JPA ...

38. Relative persistence unit inject?

I have a Persistence.xml with multiple persistence-unit definition file exists. I want to inject unit EntityManager object, according to the user who entered the system. Is it possible?

@PersistenceContext (unitName = myUnit)
In this ...

39. If I want to use hibernate with Annotation, do I have to use javax.persistence.*?

I know hibernate is an implementation of JPA, and also has its own features. I'm trying to use hibernate with annotations, but I found I have to use some annotations under ...

40. hibernate annotations

Hi Sir! I'd like to ignore the traditional mapping files, and use only the new annotation based entity mapping in my next hibernate project. I have checked hibernate org, and find an alpha release of hibernate annotations(and an ejb3 early acces lib inside). Do you think i could use this stuff right now for simple mappings, or wait until the new ...

41. annotations and reflection in Hibernate

42. Hibernate Annotations

Hibernate annotations seem to be very interesting and I am trying to use the hibernate-tools starting from a domain model. The unfortunate thing is that I can generate my ddl using hbm2ddl proper proper, but there doesn't seem to be a way to use hbm2java without hbm files. I am willing to make my own DAO velocity templates as long as ...

43. Hibernate Annotations

44. Hibernate Annotations - Are they intrusive?

When I was reading "Hibernate in Action", I liked the idea that when using Hibernate, POJOs need not implement any hibernate specific interface. The meta data describing mapping of POJO attributes and database columns are maintained outside code in .XML files. With the introduction of Hibernate Annotations, in Hibernate 3.2 onwards, its now possible to express the mapping metadata using Annotations. ...

45. How to use hibernate annotations?

Maybe, but Edward hasn't asked homework assignments before, so I am easily going to assume that it is not. To use Hibernate Annotations you just need Hibernate 3.x and Java 5.0 SDK. Annotations are Java's way of adding the features you had originally gotten from XDoclet. They take the form of @Annotation before class definition, attributes and methods of classes. By ...

46. Hibernate Annotations

47. JPA Hibernate Annotations

Hello I Use hibernate and I get use to map the class with xml files I have mapped interface that use joined-subclass to map his class implementation and it works very well. See below // map others attributes The problem is when I try to use Annotations.It doesnt ...

48. Hibernate Annotations

49. Hibernate Annotations

My website, uses Hibernate with JPA annotations running on a Tomcat server. No EJBs are used at all. It's not a complex site, with most of the data being pushed and pulled to provide some mock SCJA exam questions, but it's Hibernate and JPA doing the work. That's one of the promises of Hibernate and to a lesser extent, JPA ...

50. Hibernate 3 Annotations

I am trying to create a One to Many Relationship between two tables Orders and OrderLineItems. I am not sure what is the mistake i am doing. Can anybody tell me what is the problem with the following code. The Scenario says One Orders can have more then one OrderLineItems Order Class: public void setOrderLineItems(List orderLineitems) { this.orderLineItems = orderLineitems; } ...

51. Hibernate Annotation Yes/No

I have a database column with number(1) which stores 0/1/null values. 1)While displaying the values in the page I have to get yes for 1, no for 0 and blank for null. 2)While displaying the values in the page I have to get Retail for 0, Corporate for 1 and blank for null. Is it possible in the hibernate using annotations ...

52. Hibernate Annotations -- NamedQueries

I've been trying to establish some named queries in my application using Hibernate Annotations. I've been placing the named query annotation on my Repository classes, but they don't seem to be picked loaded. From reading the documentation I'm beginning to get the impression that the @NamedQueries is only parsed if the class also has an @Entity annotation (rather than the @Transactional ...

53. Hibernate Annotation with Native Hibernate

I love the power of annotation, but I don't like to fully use JPA since it's not as powerful as native Hibernate. For some reason, I don't really care about portability. I'm just wondering if there's anyone here using Hibernate annotation with native Hibernate. Is this kind of approach widely used in companies?

54. What is wrong with this Hibernate annotation?

Hello guys! I'm beginning with Hibernate and I read a tutorial, telling how to do one-to-many relation using annotations. Exactly what I wanted to know. It's very simple: one course has many students. //All imports correctly @Entity public class Course { @Id @GeneratedValue private int id; private String name; private int duration; @OneToMany(mappedBy="course", fetch=FetchType.LAZY) @Cascade(CascadeType.ALL) private Collection students; //All getters and ...

55. difference between jpa Annotations and Hibernate Annotations

One costs absolutely $0 and the other is free. One is a Specification and one has annotations beyond JPA. Basically Hibernate implements the JPA spec and also adds more features above th spec. so the Hiberate specific Annotations are those added features. So you use JPA annotations until you come across a mapping that forces you to use Hibernate specific features, ...

57. moving to hibernate annotations

Hi All, We currently have a Hibernate ORM implementation using the earlier approach of (cfg+hbm xml) files. We are now planning to move towards annotations. I understand for tables all the declarations in the hbm xml files will go as annotations in the POJO class. How are the cfg settings moved to annotations. Also are annotations alternative available for all tasks ...

58. Transformation to hibernate Annotation

I was using traditional mapping file in hibernate. Now I changed to hibernate annotations. So I created hibernate.cfg.xml and entity class. @Entity @Table(name = "tb_users") @NamedQueries({@NamedQuery(name = "TbUsers.findAll", query = "SELECT t FROM TbUsers t")}) public class TbUsers implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic(optional = false) @Column(name = "pki_user_id") private Integer pkiUserId; ...

59. Learning Hibernate Annotations

60. Hibernate annotations problem

I am trying to use Hibernate annotations for mapping and I get following error: org.hibernate.AnnotationException: Cannot find the expected secondary table: no servers available for annotated.Server Here is my code: org.apache.derby.jdbc.EmbeddedDriver jdbc:derby:C:/dtMonitorHibernate/target/database/HibernateTestDB;create=false 5 org.hibernate.dialect.DerbyDialect thread org.hibernate.cache.NoCacheProvider

61. Hibernate annotations and JPA

62. JPA Annotations in Hibernate 2.0

63. Problem using Annotations in hibernate

public class HibernateUtil { private static final SessionFactory sessionFactory; static { try { // Create the SessionFactory from hibernate.cfg.xml sessionFactory = new AnnotationConfiguration().addPackage("events"). addAnnotatedClass(Person.class).addAnnotatedClass(Events.class).configure().buildSessionFactory(); } catch (Throwable ex) { // Make sure you log the exception, as it might be swallowed System.err.println("Initial SessionFactory creation failed." + ex); throw new ExceptionInInitializerError(ex); } } public static SessionFactory getSessionFactory() { return sessionFactory; } } ...

64. Hibernate with annotations problems

Hello all, I am trying to configure a hibernate java project using annotations and I am getting the following error: org.postgresql.jdbc2.Jdbc2DatabaseMetaData.supportsGetGeneratedKeys()Z I have the following jars in my project: C:\Program Files\Java\jre1.6.0_07\lib\resources.jar C:\Program Files\Java\jre1.6.0_07\lib\rt.jar C:\Program Files\Java\jre1.6.0_07\lib\jsse.jar C:\Program Files\Java\jre1.6.0_07\lib\jce.jar C:\Program Files\Java\jre1.6.0_07\lib\charsets.jar C:\Program Files\Java\jre1.6.0_07\lib\ext\dnsns.jar C:\Program Files\Java\jre1.6.0_07\lib\ext\localedata.jar C:\Program Files\Java\jre1.6.0_07\lib\ext\postgresql-8.3-603.jdbc2.jar C:\Program Files\Java\jre1.6.0_07\lib\ext\sunjce_provider.jar C:\Program Files\Java\jre1.6.0_07\lib\ext\sunmscapi.jar C:\Program Files\Java\jre1.6.0_07\lib\ext\sunpkcs11.jar C:\Users\Gunnar\Documents\Text\Java\Hibernate\hibernate-distribution-3.3.2.GA\lib\required\antlr-2.7.6.jar C:\Users\Gunnar\Documents\Text\Java\Hibernate\hibernate-distribution-3.3.2.GA\lib\required\commons-collections-3.1.jar C:\Users\Gunnar\Documents\Text\Java\Hibernate\hibernate-distribution-3.3.2.GA\lib\required\dom4j-1.6.1.jar C:\Users\Gunnar\Documents\Text\Java\Hibernate\hibernate-distribution-3.3.2.GA\lib\required\javassist-3.9.0.GA.jar C:\Users\Gunnar\Documents\Text\Java\Hibernate\hibernate-distribution-3.3.2.GA\lib\required\jta-1.1.jar C:\Users\Gunnar\Documents\Text\Java\Hibernate\hibernate-distribution-3.3.2.GA\lib\required\slf4j-api-1.5.8.jar C:\Users\Gunnar\Documents\Text\Java\Hibernate\hibernate-distribution-3.3.2.GA\hibernate3.jar C:\Users\Gunnar\Documents\Text\Java\Hibernate\hibernate-annotations-3.4.0.GA\hibernate-annotations.jar C:\Users\Gunnar\Documents\Text\Java\Hibernate\hibernate-annotations-3.4.0.GA\lib\ejb3-persistence.jar C:\Users\Gunnar\Documents\Text\Java\Hibernate\hibernate-annotations-3.4.0.GA\lib\hibernate-commons-annotations.jar ...

65. Content based discrimination with Hibernate annotations

Hi folks, I am curious on an issue pertaining content based discrimination with Hibernate annotations. I've set up my entities with annotations. From an abstract base class using single table inheritance, a couple of sub-classes add some fields and use a secondary table for storing their data. Each of these sub-classes is furthermore extended by (sub-)sub-classes that simply have a different ...

67. moving from JPA standard annotations to pure hibernate annotations

All, We have a project wherein we use Hibernate as our ORM layer. We started using Annotations and got to know the Annotations we used were all JPA standard annotations. We want to change this to use pure Hibernate based Annotations. Is this task just a change of fully qualified package names from javax.*.* to org.hibernate.*.* Let me know your thoughts ...

68. Why do we use Hibernate annotations?

69. Hibernate annotation variable

Hi, I have a VO class which is mapped with a database table using annotation. However, i need to have another member variable in the class which does not have a mapping in table. This is because i need to combine two values in this class to display as another field. I guess i cannot use hbm since one of my ...

70. Hibernate Annotations

Hi all, I'm trying to move my project to Annotations and I've downloaded the latest Hibernate distribution (3.6.0 final). I created a very simple annotated class and I'm trying to add it programmatically by doing this: conf.configure().addAnnotatedClass(; This is in the documentation of the release. But I'm getting a compiler (!!!) error: The method addAnnotatedClass(Class) is undefined for the type Configuration. ...

71. Simple hibernate annotation example problem

Hi, I have copied an simple hibernate example from website, every thing compiles fine when i rum i get the following error. "Initial SessionFactory creation sqlResultSetMappings Exception in thread "main" java.lang.ExceptionInInitializerError at net.roseindia.HibernateUtil.( at net.roseindia.Example1.main( Caused by: java.lang.NoSuchFieldError: sqlResultSetMappings at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings( at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile( at org.hibernate.cfg.Configuration.buildSessionFactory( at net.roseindia.HibernateUtil.( ... 1 more Java Result: 1" package net.roseindia; import; import javax.persistence.Column; import ...

72. Hibernate with annotation

73. Hibernate and annotations

Hi, I want to develop a portlet using hibernate. My portlet works fine, when I use a xml-file for mapping. But now I want to change the mapping to annotations. I added the annotations to the bean and I modified the hibernate.cfg.xml, so that hibernate uses annotations. But it does not work. Is there anything else I have to modify?

74. Source for Hibernate annotations

75. Persisting inhiretance with annotations

Hi all I was trying to use hibernate annotations for the first time. I have created three classes: BaseEntity, Org and Chaine. Both Org and Chaine extends BaseEntity. public class BaseEntity { @Column(name= "name") private String name; @Id private Integer id; } @Entity @Table(name="chaine") public class Chaine extends BaseEntity { } @Entity @Table(name = "Org") public class Org extends BaseEntity { ...

76. Does Hibernate 3.2 w/ Annotations 3.3.1 defaults to sequenc?

Hi all, We have an application with a huge volume of concurrent inserts and out of a sudden performance started to degrade on certain scenarios (which are still not that clear). Anyways, after taking a thread dump on the WebSphere instance the application is running and analysing it on ISA we noticed that there were many (monitor) locks on an instance ...

77. Annotations - could not initialize proxy

78. one to one annotations

That is good post..well i am having a problem and it is driving me nuts. i have a scenario in which each product it link to some other product. table = product id (primary key), link(pointing to id) this link can and cannot be null.its kind of parent child relation in one table..after searching and found nothing i thought may b ...

79. annotations for enumerations

80. Annotations - general questions

Hey guys, I have a few general questions regarding annotations. [*] How do Hibernate annotations relate to javax annotations? When should I use which? [*] Are annotations preferred now to hbm.xml files? [*] What is required to have Hibernate annotations running (what kind of server etc. or no server perhaps?) Best, Mikey

81. Help with annotation

Hi, I'm using Hibernate 3.3.2.GA with an Oracle 10g database. In my Oracle table, "USER_LOGINS", I have a column, SUBVENDOR_ID, that can be NULL, but if it contains a number, that would link to the primary key of another table, named "SUBVENDOR". However, right now the Subvendor object is not getting loaded into my UserLogin model. I suspect my annotation can ...

82. Where do I have to place the annotations?

Hi, do I have to place the annotation like @Id, @GeneratedValue, etc. in front of the class-attribute or do I have to annotate the corresponding getter-method? My book says that I have to annotate the getter-methods but I had some problems with that so I tried to use the other way by annotating the attribute and it worked perfectly so I'm ...

84. Hibernate Annotations

Hi. i'm new to Hibernate Annotations please help me.? I want create the one-to-many relationship with two tables only . For eg I have configured through hbm.xml its fine what i expected : ...

85. Hibernate Annotations

86. the Problem with hibernate annotation many-to-many

have pojo class A and B public class A { @Id @GeneratedValue private Integer id; private String name; public Integer getId() { return id; } public void setId(Integer id) { = id; } @ManyToMany(cascade={CascadeType.MERGE,CascadeType.PERSIST} ) @JoinTable(name="a_b", joinColumns={@JoinColumn(name="a_id")}, inverseJoinColumns={@JoinColumn(name="b_id")} ) private List bs; public List getBs() { return bs; } public void setBs(List bs) { = bs; } public String ...

88. @Loader annotation not working

89. Annotation Scanner

At runtime I want to get a list of all the @Entity classes. When Hibernate loads it will read the classes from the persistence.xml file, or maybe it will scan the classpath. Either way, hibernate discovers all the @Entity objects. Is there a way for me to access a Collection from hibernate at runtime after hibernate has already loaded ...

90. Hibernate Annotations

Beginner Joined: Mon May 10, 2010 2:00 pm Posts: 21 I am getting this error: org.hibernate.exception.SQLGrammarException: could not get next sequence value I am using Netbeans IDE 6.9 full release. I have an Account class and am trying to insert the class. The problem is that Hibernate is looking for a sequence object in my Oracle database. I do not have ...

91. Hibernate - Annotations or Mappingfile

I would say the answer would be ... yes. In other words, I personally prefer using both. I like using annotations to show relationships, but I would avoid specifying database-specific information in your annotations, like table and column names, for instance. This will result in some redundant information, which is obviously a disadvantage. It also means that many of your annotations ...

92. Hibernate Envers - reverse @RevisionEntity annotation

Hi all, Is it possible to reverse the annotation, @RevisionEntity, instead of putting it on the RevisionEntity and indicating what listener to use, I'd like to put it on the revision listener itself and indicate which revision entity to use. Since the listener is dependent on the entity, the relationship shows that more clearly this way. Also, it lets you pull ...

93. Visible of Annotations

94. Hibernate Common Annotations -- Release 3.5.x?

org.hibernate ...

95. Hibernate annotations

Hi, I created a table in MySQL: 'object_label' with columns 'id' and 'name'. I inserted values to this table. In java I created new class -'ObjectLabel': Code: @Entity @Table(name = "object_label") public class ObjectLabel implements Serializable { private ...

96. Why Hibernate annotations?

97. @any annotation for Java

Based on the documentation I can find it does not appear that the @any functionality is available as an annotation for Java. I am using JAXB with Hibernate and do not have the ability to use the XML logic. I need this functionality to work with a database of legacy data. Is there a work around or are there plans ...

98. With Annotations retrieving records

Author Message kotapati.krishna Post subject: With Annotations retrieving records Posted: Fri Sep 24, 2010 10:09 pm Newbie Joined: Tue Jul 20, 2010 1:53 am Posts: 18 I can't retrieving the records ..?For below code. // obj,Factory obj . . .) import java.util.*; import*; import org.hibernate.*; import org.hibernate.cfg.*; //import org.hibernate.connection.*; public class Client { public static void main(String[] args)throws ...

99. jboss6 M5 Hibernate @Any annotation

20:33:14,667 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=cm.war#primary state=Create: java.lang.UnsupportedOperationException: any not supported yet at org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata( [:3.5.5-Final] at org.hibernate.ejb.metamodel.AttributeFactory.buildAttribute( [:3.5.5-Final] at org.hibernate.ejb.metamodel.MetadataContext.wrapUp( [:3.5.5-Final] at org.hibernate.ejb.metamodel.MetamodelImpl.buildMetamodel( [:3.5.5-Final] at org.hibernate.ejb.EntityManagerFactoryImpl.( [:3.5.5-Final] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory( [:3.5.5-Final] at ...

100. Question about Hibernate, Annotation and JPA

Hello all, Im learning Hibernate and have a very simple question. what's the relationship between Hibernate and JPA? In my opinion, "pure" hibernate use XML metadata and hibernate native API, they are strong but not obey EJB3 specification. "pure" EJB3 use JPA Annotation (or JPA XML metadata), and JPA API, but they can only be used in an EJB3 Application Server ...