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

Exception thrown by Configuration.getRootClassMapping(String) not helpful

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects versions: 3.3.2
    • Fix versions: 4.2.8, 4.3.0.CR2
    • Components: None
    • Labels:
      None
    • Environment:
      hibernate-core-3.3.2.GA.jar
    • Last commented by a user?:
      true
    • Sprint:

      Description

      current code:

      	RootClass getRootClassMapping(String clazz) throws MappingException {
      		try {
      			return (RootClass) getClassMapping( clazz );
      		}
      		catch (ClassCastException cce) {
      			throw new MappingException( "You may only specify a cache for root <class&gt; mappings" );
      		}
      	}
      

      this causes exception message to be "You may only specify a cache for root <class> mappings". As a result, the user will have to check all cache configurations or set a breakpoint to get the value of clazz that caused the error. To simplify this process, add clazz to the message, e.g. "You may only specify a cache for root <class> mappings, was " + clazz

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

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