java.lang.UnsupportedOperationException: any not supported yet

Hibernate JIRA | Robert Brady | 5 years ago
  1. 0

    [HHH-6589] Skip non-JPA features populating JPA "static metamodel" - Hibernate JIRA

    atlassian.net | 1 year ago
    java.lang.UnsupportedOperationException: any not supported yet
  2. 0

    I am upgrading from Hibernate 3.2.x to 3.5.5 and getting UnsupportedOperationExceptions thrown when Hibernate is trying to create the metamodel. This is due to the dependency of my application upon jBPM 3.x, which uses "any" mappings for some of its classes. The exception occurs in org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(...) {noFormat} java.lang.UnsupportedOperationException: any not supported yet at org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(AttributeFactory.java:452) {noFormat} It is due to the logic in AttributeFactory at line 451: {noFormat} if ( type.isAnyType() ) { throw new UnsupportedOperationException( "any not supported yet" ); } {noFormat} The "Big Hammer" approach of globally disabling the creation of the metamodel with the property setting: {noFormat} hibernate.ejb.metamodel.generation=disabled {noFormat} is not feasible: other components in my application depend upon the criteria search api, which need a generated meatamodel. Splitting the single application persistence unit into two parts ( one for the jBPM persisted classes with metamodel disabled and all other classes with metamodel enabled) is not feasible either. The split persistence unit approach would also split transaction boundaries of operations that are desired to be in a single transaction. Hibernate should support "any" mappings in the metamodel. The @Any annotation is supported in Hibernate Annotation 3.5.5. If Hibernate can not support "any" mappings then maybe it could: * Allow the exclusion of persistent classes by package in the metamodel. I tried this successfully by changing the following code in org.hibernate.ejb.EntityManagerFactoryImpl constructor: {noFormat} ... List<PersistentClass> persistentClasses = new ArrayList<PersistentClass>(); while (classes.hasNext()) { PersistentClass persistentClass = classes.next(); // Hardcode jBPM classes for now, but make tidy with a property like "hibernate.ejb.metamodel.excluded.pkgs" if (persistentClass.getClassName().startsWith("org.jbpm")) { continue; } else { persistentClasses.add(persistentClass); } } // a safe guard till we are confident that metamodel is wll tested if (!"disabled".equalsIgnoreCase(cfg.getProperty("hibernate.ejb.metamodel.generation"))) { this.metamodel = MetamodelImpl.buildMetamodel(persistentClasses.iterator(), (SessionFactoryImplementor) sessionFactory);} ... {noFormat} * Exclude persistent classes having "any" mappings from the metamodel generation.

    Hibernate JIRA | 5 years ago | Robert Brady
    java.lang.UnsupportedOperationException: any not supported yet
  3. 0

    I am upgrading from Hibernate 3.2.x to 3.5.5 and getting UnsupportedOperationExceptions thrown when Hibernate is trying to create the metamodel. This is due to the dependency of my application upon jBPM 3.x, which uses "any" mappings for some of its classes. The exception occurs in org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(...) {noFormat} java.lang.UnsupportedOperationException: any not supported yet at org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(AttributeFactory.java:452) {noFormat} It is due to the logic in AttributeFactory at line 451: {noFormat} if ( type.isAnyType() ) { throw new UnsupportedOperationException( "any not supported yet" ); } {noFormat} The "Big Hammer" approach of globally disabling the creation of the metamodel with the property setting: {noFormat} hibernate.ejb.metamodel.generation=disabled {noFormat} is not feasible: other components in my application depend upon the criteria search api, which need a generated meatamodel. Splitting the single application persistence unit into two parts ( one for the jBPM persisted classes with metamodel disabled and all other classes with metamodel enabled) is not feasible either. The split persistence unit approach would also split transaction boundaries of operations that are desired to be in a single transaction. Hibernate should support "any" mappings in the metamodel. The @Any annotation is supported in Hibernate Annotation 3.5.5. If Hibernate can not support "any" mappings then maybe it could: * Allow the exclusion of persistent classes by package in the metamodel. I tried this successfully by changing the following code in org.hibernate.ejb.EntityManagerFactoryImpl constructor: {noFormat} ... List<PersistentClass> persistentClasses = new ArrayList<PersistentClass>(); while (classes.hasNext()) { PersistentClass persistentClass = classes.next(); // Hardcode jBPM classes for now, but make tidy with a property like "hibernate.ejb.metamodel.excluded.pkgs" if (persistentClass.getClassName().startsWith("org.jbpm")) { continue; } else { persistentClasses.add(persistentClass); } } // a safe guard till we are confident that metamodel is wll tested if (!"disabled".equalsIgnoreCase(cfg.getProperty("hibernate.ejb.metamodel.generation"))) { this.metamodel = MetamodelImpl.buildMetamodel(persistentClasses.iterator(), (SessionFactoryImplementor) sessionFactory);} ... {noFormat} * Exclude persistent classes having "any" mappings from the metamodel generation.

    Hibernate JIRA | 5 years ago | Robert Brady
    java.lang.UnsupportedOperationException: any not supported yet
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate Community • View topic - Hibernate 3.5 CR1: "any" Mapping declaration not supported

    hibernate.org | 1 year ago
    java.lang.UnsupportedOperationException: any not supported yet
  6. 0

    Hibernate 3.5 or 3.6 with no supporting to @Any annotation?

    Stack Overflow | 6 years ago | Lucas de Oliveira
    java.lang.UnsupportedOperationException: any not supported yet

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.UnsupportedOperationException

      any not supported yet

      at org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata()
    2. Hibernate EJB
      AttributeFactory.determineAttributeMetadata
      1. org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(AttributeFactory.java:452)
      1 frame