File tree 2 files changed +31
-21
lines changed
tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation
2 files changed +31
-21
lines changed Original file line number Diff line number Diff line change @@ -88,28 +88,37 @@ void comment(StringBuilder declaration) {
88
88
.append ("{@link " )
89
89
.append (annotationMetaEntity .importType (entity ))
90
90
.append ("} by " );
91
- int paramCount = paramNames .size ();
92
- for (int i = 0 ; i < paramCount ; i ++) {
93
- String param = paramNames .get (i );
94
- if ( i >0 ) {
95
- if ( i + 1 == paramCount ) {
96
- declaration
97
- .append (paramCount >2 ? ", and " : " and " ); //Oxford comma
98
- }
99
- else {
100
- declaration
101
- .append (", " );
91
+ long paramCount = paramTypes .stream ()
92
+ .filter (type -> !isOrderParam (type ) && !isPageParam (type )
93
+ && !isSessionParameter (type ))
94
+ .count ();
95
+ int count = 0 ;
96
+ for (int i = 0 ; i < paramTypes .size (); i ++) {
97
+ String type = paramTypes .get (i );
98
+ if ( !isPageParam (type ) && !isOrderParam (type )
99
+ && !isSessionParameter (type ) ) {
100
+ if ( count >0 ) {
101
+ if ( count + 1 == paramCount ) {
102
+ declaration
103
+ .append (paramCount >2 ? ", and " : " and " ); //Oxford comma
104
+ }
105
+ else {
106
+ declaration
107
+ .append (", " );
108
+ }
102
109
}
110
+ count ++;
111
+ final String path = paramNames .get (i )
112
+ .replace ('$' , '.' );
113
+ declaration
114
+ .append ("{@link " )
115
+ .append (annotationMetaEntity .importType (entity ))
116
+ .append ('#' )
117
+ .append (qualifier (path ))
118
+ .append (' ' )
119
+ .append (path )
120
+ .append ("}" );
103
121
}
104
- final String path = param .replace ('$' , '.' );
105
- declaration
106
- .append ("{@link " )
107
- .append (annotationMetaEntity .importType (entity ))
108
- .append ('#' )
109
- .append (qualifier (path ))
110
- .append (' ' )
111
- .append (path )
112
- .append ("}" );
113
122
}
114
123
declaration
115
124
.append ('.' )
Original file line number Diff line number Diff line change @@ -254,7 +254,8 @@ private String getConstantName() {
254
254
else {
255
255
return stem + "_"
256
256
+ paramTypes .stream ()
257
- .filter (name -> !isPageParam (name ) && !isOrderParam (name ))
257
+ .filter (type -> !isPageParam (type ) && !isOrderParam (type )
258
+ && !isSessionParameter (type ))
258
259
.map (StringHelper ::unqualify )
259
260
.reduce ((x ,y ) -> x + '_' + y )
260
261
.orElse ("" );
You can’t perform that action at this time.
0 commit comments