Uploaded image for project: 'Hibernate ORM'
  1. HHH-9369

@Formula of enum type results in ClassCastException

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      	@Formula("(select 'A' from dual)")
      	@Enumerated(EnumType.STRING)
      	private Trimmed formula;
      

      results in:

      java.lang.ClassCastException: org.hibernate.mapping.Formula cannot be cast to org.hibernate.mapping.Column
      	at org.hibernate.mapping.SimpleValue.createParameterImpl(SimpleValue.java:499)
      	at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:324)
      	at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:310)
      	at org.hibernate.mapping.Property.isValid(Property.java:241)
      	at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:496)
      	at org.hibernate.mapping.RootClass.validate(RootClass.java:270)
      	at org.hibernate.cfg.Configuration.validate(Configuration.java:1358)
      	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1849)
      	at org.hibernate.testing.junit4.BaseCoreFunctionalTestCase.buildSessionFactory(BaseCoreFunctionalTestCase.java:149)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.hibernate.testing.junit4.TestClassMetadata.performCallbackInvocation(TestClassMetadata.java:205)
      	... 15 more
      

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified