Author: vyemialyanchyk
Date: 2008-10-20 09:37:37 -0400 (Mon, 20 Oct 2008)
New Revision: 10986
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/process/ProcessEntityInfo.java
Log:
JBIDE-2930
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 2008-10-20
13:34:17 UTC (rev 10985)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2008-10-20
13:37:37 UTC (rev 10986)
@@ -264,7 +264,15 @@
public boolean visit(FieldDeclaration node) {
if (node.getType().isPrimitiveType()) {
PrimitiveType pt = (PrimitiveType)node.getType();
- ITypeBinding tb = pt.resolveBinding();
+ if (!pt.getPrimitiveTypeCode().equals(PrimitiveType.BOOLEAN)) {
+ // this is candidate for primary id
+ Iterator itVarNames = node.fragments().iterator();
+ while (itVarNames.hasNext()) {
+ VariableDeclarationFragment var = (VariableDeclarationFragment)itVarNames.next();
+ String name = var.getName().getIdentifier();
+ entityInfo.addPrimaryIdCandidate(name);
+ }
+ }
} else if (node.getType().isSimpleType()) {
SimpleType st = (SimpleType)node.getType();
ITypeBinding tb = st.resolveBinding();
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java
===================================================================
---
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2008-10-20
13:34:17 UTC (rev 10985)
+++
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/process/ProcessEntityInfo.java 2008-10-20
13:37:37 UTC (rev 10986)
@@ -145,7 +145,7 @@
}
public boolean visit(FieldDeclaration node) {
- if (node.getType().isSimpleType()) {
+ if (node.getType().isSimpleType() || node.getType().isPrimitiveType()) {
if (entityInfo.isAddGeneratedValueFlag()) {
String primaryIdName = entityInfo.getPrimaryIdName();
Iterator itVarNames = node.fragments().iterator();
Show replies by date