arminw 2005/01/26 16:08:31
Modified: src/java/org/apache/ojb/broker/metadata Tag: OJB_1_0_RELEASE
ClassDescriptor.java
Log:
minor refactoring
Revision Changes Path
No revision
No revision
1.88.2.5 +14 -17
db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java
Index: ClassDescriptor.java
===================================================================
RCS file:
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java,v
retrieving revision 1.88.2.4
retrieving revision 1.88.2.5
diff -u -r1.88.2.4 -r1.88.2.5
--- ClassDescriptor.java 25 Jan 2005 20:00:52 -0000 1.88.2.4
+++ ClassDescriptor.java 27 Jan 2005 00:08:31 -0000 1.88.2.5
@@ -19,6 +19,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
+import java.lang.reflect.Proxy;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
@@ -48,8 +49,6 @@
import org.apache.ojb.broker.util.configuration.Configurator;
import org.apache.ojb.broker.util.configuration.impl.OjbConfigurator;
import org.apache.ojb.broker.util.logging.LoggerFactory;
-//#ifdef JDK13
-import java.lang.reflect.Proxy;
//#else
/*
import net.sf.cglib.proxy.Proxy;
@@ -974,7 +973,7 @@
}
/**
- * return an array of PK FieldDescription sorted ascending
+ * Return an array of PK FieldDescription sorted ascending
* according to the field-descriptions getOrder() property
*/
public FieldDescriptor[] getPkFields()
@@ -996,26 +995,24 @@
Class implementor = (Class) getExtentClasses().get(0);
ClassDescriptor implCld =
this.getRepository().getDescriptorFor(implementor);
m_PkFieldDescriptors = implCld.getPkFields();
- return m_PkFieldDescriptors;
}
- // 1.b if not an interface The classdescriptor must have
FieldDescriptors
else
{
+ // 1.b if not an interface The classdescriptor must have
FieldDescriptors
fields = getFieldDescriptions();
- }
-
- // now collect all PK fields
- for (int i = 0; i < fields.length; i++)
- {
- FieldDescriptor fd = fields[i];
- if (fd.isPrimaryKey())
+ // now collect all PK fields
+ for (int i = 0; i < fields.length; i++)
{
- vec.add(fd);
+ FieldDescriptor fd = fields[i];
+ if (fd.isPrimaryKey())
+ {
+ vec.add(fd);
+ }
}
+ // 2. Sort fields according to their getOrder() Property
+ Collections.sort(vec, FieldDescriptor.getComparator());
+ m_PkFieldDescriptors = (FieldDescriptor[]) vec.toArray(new
FieldDescriptor[vec.size()]);
}
- // 2. Sort fields according to their getOrder() Property
- Collections.sort(vec, FieldDescriptor.getComparator());
- m_PkFieldDescriptors = (FieldDescriptor[]) vec.toArray(new
FieldDescriptor[vec.size()]);
}
return m_PkFieldDescriptors;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]