Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is the relevant Code from <code>JPAOverridenAnnotationReader</code> (I'm using 3.5.6, but that probably hasn't changed much):</p> <pre><code>Element element = tree != null ? tree.element( "attributes" ) : null; //put entity.attributes elements if ( element != null ) { //precompute the list of properties //TODO is it really useful... Set&lt;String&gt; properties = new HashSet&lt;String&gt;(); for (Field field : clazz.getFields()) { properties.add( field.getName() ); } for (Method method : clazz.getMethods()) { String name = method.getName(); if ( name.startsWith( "get" ) ) { properties.add( Introspector.decapitalize( name.substring( "get".length() ) ) ); } else if ( name.startsWith( "is" ) ) { properties.add( Introspector.decapitalize( name.substring( "is".length() ) ) ); } } for (Element subelement : (List&lt;Element&gt;) element.elements()) { String propertyName = subelement.attributeValue( "name" ); if ( !properties.contains( propertyName ) ) { log.warn( "Property {} not found in class" + " but described in &lt;mapping-file/&gt; (possible typo error)", StringHelper.qualify( className, propertyName ) ); } } } </code></pre> <p>I don't see where the bug you describe should occur.</p> <p>This code:</p> <pre><code>for (Field field : clazz.getFields()) { properties.add( field.getName() ); } </code></pre> <p>adds all field names and this code</p> <pre><code>if ( !properties.contains( propertyName ) ) { log.warn( "Property {} not found in class" + " but described in &lt;mapping-file/&gt; (possible typo error)", StringHelper.qualify( className, propertyName ) ); </code></pre> <p>checks if the field name mapped in the XML exists in the class. None of these do any String processing (String processing is only done for methods). I'd say you have a typo somewhere.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload