Author: dgeraskov
Date: 2011-05-05 09:22:57 -0400 (Thu, 05 May 2011)
New Revision: 31099
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/fields/Country.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Country.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/Country.java
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Country.java
Log:
https://issues.jboss.org/browse/JBIDE-8028
Do not annotate static or final fields
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2011-05-05
10:09:15 UTC (rev 31098)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2011-05-05
13:22:57 UTC (rev 31099)
@@ -421,6 +421,10 @@
}
public boolean visit(FieldDeclaration node) {
+ //do not map static or final fields
+ if ((node.getModifiers() & (Modifier.FINAL | Modifier.STATIC)) != 0){
+ return false;
+ }
Type type = node.getType();
List<String> list = new ArrayList<String>();
Iterator<VariableDeclarationFragment> itVarNames = node.fragments().iterator();
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/fields/Country.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/fields/Country.java 2011-05-05
10:09:15 UTC (rev 31098)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/fields/Country.java 2011-05-05
13:22:57 UTC (rev 31099)
@@ -12,6 +12,10 @@
public class Country {
+ private static int fake_id;
+
+ private final int fake_id2 = 1;
+
private String name;
protected Visa visa;
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Country.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Country.java 2011-05-05
10:09:15 UTC (rev 31098)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/project/test/annotated/getters/Country.java 2011-05-05
13:22:57 UTC (rev 31099)
@@ -12,6 +12,10 @@
public class Country {
+ private static int fake_id;
+
+ private final int fake_id2 = 1;
+
private String name;
public Country(String name) {
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/Country.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/Country.java 2011-05-05
10:09:15 UTC (rev 31098)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/fields/Country.java 2011-05-05
13:22:57 UTC (rev 31099)
@@ -18,6 +18,10 @@
@Entity
public class Country {
+ private static int fake_id;
+
+ private final int fake_id2 = 1;
+
@Column(length=200)
private String name;
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Country.java
===================================================================
---
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Country.java 2011-05-05
10:09:15 UTC (rev 31098)
+++
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/res/specimen/test/annotated/getters/Country.java 2011-05-05
13:22:57 UTC (rev 31099)
@@ -16,6 +16,10 @@
@Entity
public class Country {
+ private static int fake_id;
+
+ private final int fake_id2 = 1;
+
private String name;
protected Country() {