Author: vyemialyanchyk
Date: 2008-10-20 10:45:26 -0400 (Mon, 20 Oct 2008)
New Revision: 10999
Modified:
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
Log:
JBIDE-2930
Modified:
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java
===================================================================
---
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2008-10-20
14:31:24 UTC (rev 10998)
+++
branches/jbosstools-3.0.0.Beta1/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/jpa/collect/CollectEntityInfo.java 2008-10-20
14:45:26 UTC (rev 10999)
@@ -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();
Show replies by date