empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r732673 - in /incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean: BeanClass.java BeanRecordProxy.java
Date Thu, 08 Jan 2009 10:12:57 GMT
Author: doebele
Date: Thu Jan  8 02:12:56 2009
New Revision: 732673

URL: http://svn.apache.org/viewvc?rev=732673&view=rev
Log:
EMPIREDB-33

Modified:
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanClass.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanRecordProxy.java

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanClass.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanClass.java?rev=732673&r1=732672&r2=732673&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanClass.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanClass.java
Thu Jan  8 02:12:56 2009
@@ -45,6 +45,12 @@
         this.name = name;
     }
 
+    protected BeanClass(String name, BeanDomain dom) 
+    {
+        this(name);
+        dom.addClass(this);
+    }
+
     protected void addProp(BeanProperty prop)
     {
         properties.add(prop);
@@ -67,7 +73,7 @@
 
     protected final BeanProperty addProp(String propname, DataType dataType, double size,
boolean required, String controlType, boolean readOnly)
     {
-        BeanProperty prop = new BeanProperty(propname, dataType, size, required, controlType,
required);
+        BeanProperty prop = new BeanProperty(propname, dataType, size, required, controlType,
readOnly);
         addProp(prop);
         return prop;
     }

Modified: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanRecordProxy.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanRecordProxy.java?rev=732673&r1=732672&r2=732673&view=diff
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanRecordProxy.java
(original)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanRecordProxy.java
Thu Jan  8 02:12:56 2009
@@ -33,6 +33,7 @@
 import org.apache.empire.commons.Options;
 import org.apache.empire.data.Column;
 import org.apache.empire.data.ColumnExpr;
+import org.apache.empire.data.DataType;
 import org.apache.empire.data.Record;
 
 
@@ -150,7 +151,11 @@
 
     public boolean isFieldReadOnly(Column column)
     {
-        return ObjectUtils.contains(keyColumns, column);
+    	if (isNew()==false && ObjectUtils.contains(keyColumns, column))
+    		return true;
+    	if (column.getDataType()==DataType.AUTOINC)
+    		return true;
+        return column.isReadOnly();
     }
 
     public boolean isFieldVisible(Column column)



Mime
View raw message