-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Hibernate 3.5 CR1: "any" Mapping declaration not supported
PostPosted: Mon Mar 01, 2010 6:14 am 
Newbie

Joined: Mon Mar 01, 2010 4:41 am
Posts: 1
In the attempt of migrating an application using JBPM 3.x to the upcoming JBoss 6 release (including Hibernate 3.5 CR1) I stumbled over the Hibernate Exception:
Code:
java.lang.UnsupportedOperationException: any not supported yet
at org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(AttributeFactory.java:441)

generated by hibernate 3.5 ejb.metamodel.AttributeFactory:
http://anonsvn.jboss.org/repos/hibernat ... ctory.java
Code:
....
if ( type.isAnyType() ) {
         throw new UnsupportedOperationException( "any not supported yet" );
      }
...

My questions are:
1. Will "any" be supported in the final 3.5 release finally?
2. In the mentioned project (working with JBoss 4.0.5) JBPM is configured to use the JBoss Datasource (hbm.xml files using the any declaration mapping,
are included into the ejb persistence.xml) and is referenced as an "ear module". Is there a configuration possibility to
not trigger the hibernate "ejb.metamodel.AttributeFactory" but something like a "plain Hibernate" attributeFactory for such Entities?


Top
 Profile  
 
 Post subject: Re: Hibernate 3.5 CR1: "any" Mapping declaration not supported
PostPosted: Wed Mar 03, 2010 1:43 am 
Newbie

Joined: Tue Apr 17, 2007 5:50 pm
Posts: 5
Did you have any luck with this? I'm facing the same issue as you with jBPM 4.3. I'm attempting to add my jBPM mapping files to persistence.xml, but it fails with the error message:

ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#persistenceUnit state=Create: java.lang.UnsupportedOperationException: any not supported yet

Did you find a solution to the problem by chance?


Top
 Profile  
 
 Post subject: Re: Hibernate 3.5 CR1: "any" Mapping declaration not supported
PostPosted: Mon Aug 09, 2010 11:21 am 
Newbie

Joined: Mon Aug 09, 2010 10:53 am
Posts: 1
I'm migrating from Hibernate 3.3.1.GA to 3.5.4-Final and this still appears to be a problem. I have a class that extends AbstractType and returns true from isAnyType(). I get the following stack trace from hibernate during initialization of the Spring ApplicationContext:
...
Caused by: java.lang.UnsupportedOperationException: any not supported yet
at org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(AttributeFactory.java:452)
at org.hibernate.ejb.metamodel.AttributeFactory.buildAttribute(AttributeFactory.java:93)
at org.hibernate.ejb.metamodel.AttributeFactory.getMetaModelType(AttributeFactory.java:225)
at org.hibernate.ejb.metamodel.AttributeFactory.buildAttribute(AttributeFactory.java:102)
at org.hibernate.ejb.metamodel.MetadataContext.wrapUp(MetadataContext.java:183)
at org.hibernate.ejb.metamodel.MetamodelImpl.buildMetamodel(MetamodelImpl.java:66)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:891)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:74)
...

This issue is blocking the migration -- is there a solution or workaround available?


Top
 Profile  
 
 Post subject: Re: Hibernate 3.5 CR1: "any" Mapping declaration not supported
PostPosted: Wed Nov 17, 2010 1:37 pm 
Newbie

Joined: Wed Nov 17, 2010 7:28 am
Posts: 3
the same on 3.6.Final

I don't understand why @Any is in the documentation if it's not managed.

HOW TO DO THIS ?
Code:

@Any(metaColumn = @Column(name = "meta_type",insertable=false,updatable=false),fetch=FetchType.EAGER)
   @AnyMetaDef(idType = "long", metaType = "string", metaValues = {
         @org.hibernate.annotations.MetaValue(targetEntity = MetaValueString.class, value = "STRING"),
         @org.hibernate.annotations.MetaValue(targetEntity = MetaValueNumber.class, value = "NUMBER") })
   @JoinColumn(name = "meta_id")
   private AMetaValue metaValue;


Top
 Profile  
 
 Post subject: Re: Hibernate 3.5 CR1: "any" Mapping declaration not supported
PostPosted: Tue Nov 23, 2010 4:01 pm 
Newbie

Joined: Thu Aug 24, 2006 4:18 pm
Posts: 3
Hi there,
did any of you guys find any solution to this matter?

thanks a lot!


Top
 Profile  
 
 Post subject: Re: Hibernate 3.5 CR1: "any" Mapping declaration not supported
PostPosted: Wed Nov 24, 2010 5:33 am 
Newbie

Joined: Wed Nov 17, 2010 7:28 am
Posts: 3
WELCOME IN JBOSS WORLD !!
NO ADMIN, NO REPLY, NO...BODY???


Top
 Profile  
 
 Post subject: Re: Hibernate 3.5 CR1: "any" Mapping declaration not supported
PostPosted: Tue Dec 14, 2010 9:55 am 
Newbie

Joined: Tue Dec 14, 2010 9:44 am
Posts: 1
I found a solution to this problem.
The problems is due to the JPA2 metamodel support. If you don't use the JPA2 metamodel you can deactivate it with setting the hibernate property:
hibernate.ejb.metamodel.generation=disable


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.