@@ -1949,7 +1949,7 @@ private static void bindNamedAttributeNodes(Element subElement, AnnotationDescri
1949
1949
List <NamedAttributeNode > annNamedAttributeNodes = new ArrayList <NamedAttributeNode >( );
1950
1950
for (Element namedAttributeNode : namedAttributeNodes ){
1951
1951
AnnotationDescriptor annNamedAttributeNode = new AnnotationDescriptor ( NamedAttributeNode .class );
1952
- copyStringAttribute ( annNamedAttributeNode , namedAttributeNode , "value" , true );
1952
+ copyStringAttribute ( annNamedAttributeNode , namedAttributeNode , "value" , "name" , true );
1953
1953
copyStringAttribute ( annNamedAttributeNode , namedAttributeNode , "subgraph" , false );
1954
1954
copyStringAttribute ( annNamedAttributeNode , namedAttributeNode , "key-subgraph" , false );
1955
1955
annNamedAttributeNodes .add ( (NamedAttributeNode ) AnnotationFactory .create ( annNamedAttributeNode ) );
@@ -2903,12 +2903,42 @@ private PrimaryKeyJoinColumn[] buildPrimaryKeyJoinColumns(Element element) {
2903
2903
return pkJoinColumns ;
2904
2904
}
2905
2905
2906
+ /**
2907
+ * Copy a string attribute from an XML element to an annotation descriptor. The name of the annotation attribute is
2908
+ * computed from the name of the XML attribute by {@link #getJavaAttributeNameFromXMLOne(String)}.
2909
+ *
2910
+ * @param annotation annotation descriptor where to copy to the attribute.
2911
+ * @param element XML element from where to copy the attribute.
2912
+ * @param attributeName name of the XML attribute to copy.
2913
+ * @param mandatory whether the attribute is mandatory.
2914
+ */
2906
2915
private static void copyStringAttribute (
2907
- AnnotationDescriptor annotation , Element element , String attributeName , boolean mandatory
2908
- ) {
2916
+ final AnnotationDescriptor annotation , final Element element ,
2917
+ final String attributeName , final boolean mandatory ) {
2918
+ copyStringAttribute (
2919
+ annotation ,
2920
+ element ,
2921
+ getJavaAttributeNameFromXMLOne ( attributeName ),
2922
+ attributeName ,
2923
+ mandatory
2924
+ );
2925
+ }
2926
+
2927
+ /**
2928
+ * Copy a string attribute from an XML element to an annotation descriptor. The name of the annotation attribute is
2929
+ * explicitely given.
2930
+ *
2931
+ * @param annotation annotation where to copy to the attribute.
2932
+ * @param element XML element from where to copy the attribute.
2933
+ * @param annotationAttributeName name of the annotation attribute where to copy.
2934
+ * @param attributeName name of the XML attribute to copy.
2935
+ * @param mandatory whether the attribute is mandatory.
2936
+ */
2937
+ private static void copyStringAttribute (
2938
+ final AnnotationDescriptor annotation , final Element element ,
2939
+ final String annotationAttributeName , final String attributeName , boolean mandatory ) {
2909
2940
String attribute = element .attributeValue ( attributeName );
2910
2941
if ( attribute != null ) {
2911
- String annotationAttributeName = getJavaAttributeNameFromXMLOne ( attributeName );
2912
2942
annotation .setValue ( annotationAttributeName , attribute );
2913
2943
}
2914
2944
else {
0 commit comments