Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[NUCRDBMS-768] - Do not include synthetic fields for query result

  • Loading branch information...
commit 827f796c35066ade3eb9a360eb10cdab03ce53d9 1 parent 21f8f87
@renataogarcia renataogarcia authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/java/org/datanucleus/store/rdbms/query/ResultClassROF.java
View
10 src/java/org/datanucleus/store/rdbms/query/ResultClassROF.java
@@ -18,6 +18,7 @@
package org.datanucleus.store.rdbms.query;
import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -499,12 +500,15 @@ else if (obj instanceof StatementNewObjectMapping)
*/
private void populateDeclaredFieldsForUserType(Class cls)
{
- for (int i=0;i<cls.getDeclaredFields().length;i++)
+ Field[] declaredFields = cls.getDeclaredFields();
+ for (int i=0;i<declaredFields.length;i++)
{
- if (resultClassFieldsByName.put(cls.getDeclaredFields()[i].getName().toUpperCase(), cls.getDeclaredFields()[i]) != null)
+ Field field = declaredFields[i];
+ if (!field.isSynthetic()
+ && resultClassFieldsByName.put(field.getName().toUpperCase(), field) != null)
{
throw new NucleusUserException(LOCALISER.msg("021210",
- cls.getDeclaredFields()[i].getName()));
+ field.getName()));
}
}
if (cls.getSuperclass() != null)
Please sign in to comment.
Something went wrong with that request. Please try again.