summaryrefslogtreecommitdiff
path: root/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EOAttribute.java
diff options
context:
space:
mode:
authorBenjamin Culkin <scorpress@gmail.com>2024-05-20 17:58:16 -0400
committerBenjamin Culkin <scorpress@gmail.com>2024-05-20 17:58:16 -0400
commit40a9d99496e098562f090fb7ffce9e749011b131 (patch)
tree437df24d65470582e943e494a52db8ed65a881ae /projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EOAttribute.java
parentff072dfe782f6f22123cd4ba050828d35c0d0fbd (diff)
Formatting pass
Diffstat (limited to 'projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EOAttribute.java')
-rw-r--r--projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EOAttribute.java114
1 files changed, 65 insertions, 49 deletions
diff --git a/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EOAttribute.java b/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EOAttribute.java
index 8b651ec..d77a162 100644
--- a/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EOAttribute.java
+++ b/projects/net.wotonomy.persistence/src/main/java/net/wotonomy/access/EOAttribute.java
@@ -22,18 +22,18 @@ import net.wotonomy.foundation.NSMutableDictionary;
import net.wotonomy.foundation.NSSelector;
/**
-* Represents an attribute inside an entity. Contains mapping data for
-* the attribute's external name, external and internal datatypes, etc.
-* It can also represent a flattened or derived attribute, or a prototype;
-* and they are also used to represent parameters in a stored procedure.
-*
-* @author ezamudio@nasoft.com
-* @author $Author: cgruber $
-* @version $Revision: 894 $
-*/
+ * Represents an attribute inside an entity. Contains mapping data for the
+ * attribute's external name, external and internal datatypes, etc. It can also
+ * represent a flattened or derived attribute, or a prototype; and they are also
+ * used to represent parameters in a stored procedure.
+ *
+ * @author ezamudio@nasoft.com
+ * @author $Author: cgruber $
+ * @version $Revision: 894 $
+ */
public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
- //These are used for stored procedure parameters.
+ // These are used for stored procedure parameters.
public static final int Void = 0;
public static final int InParameter = 1;
public static final int OutParameter = 2;
@@ -75,26 +75,26 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public EOAttribute(NSDictionary dict, Object obj) {
super();
if (obj instanceof EOEntity)
- _entity = (EOEntity)obj;
- setName((String)dict.objectForKey("name"));
+ _entity = (EOEntity) obj;
+ setName((String) dict.objectForKey("name"));
if (dict.objectForKey("columnName") != null)
- setColumnName((String)dict.objectForKey("columnName"));
+ setColumnName((String) dict.objectForKey("columnName"));
if (dict.objectForKey("definition") != null)
- setDefinition((String)dict.objectForKey("definition"));
- _prototypeName = (String)dict.objectForKey("prototypeName");
- setExternalType((String)dict.objectForKey("externalType"));
- setClassName((String)dict.objectForKey("valueClassName"));
- setValueType((String)dict.objectForKey("valueType"));
- _writeFormat = (String)dict.objectForKey("writeFormat");
- _readFormat = (String)dict.objectForKey("readFormat");
+ setDefinition((String) dict.objectForKey("definition"));
+ _prototypeName = (String) dict.objectForKey("prototypeName");
+ setExternalType((String) dict.objectForKey("externalType"));
+ setClassName((String) dict.objectForKey("valueClassName"));
+ setValueType((String) dict.objectForKey("valueType"));
+ _writeFormat = (String) dict.objectForKey("writeFormat");
+ _readFormat = (String) dict.objectForKey("readFormat");
if (dict.objectForKey("precision") != null)
- setPrecision(Integer.parseInt((String)dict.objectForKey("precision")));
+ setPrecision(Integer.parseInt((String) dict.objectForKey("precision")));
if (dict.objectForKey("scale") != null)
- setScale(Integer.parseInt((String)dict.objectForKey("scale")));
+ setScale(Integer.parseInt((String) dict.objectForKey("scale")));
if (dict.objectForKey("width") != null)
- setWidth(Integer.parseInt((String)dict.objectForKey("width")));
+ setWidth(Integer.parseInt((String) dict.objectForKey("width")));
if (dict.objectForKey("parameterDirection") != null)
- setParameterDirection(Integer.parseInt((String)dict.objectForKey("parameterDirection")));
+ setParameterDirection(Integer.parseInt((String) dict.objectForKey("parameterDirection")));
setAllowsNull("Y".equals(dict.objectForKey("allowsNull")));
}
@@ -105,6 +105,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setName(String name) {
_name = name;
}
+
public String name() {
return _name;
}
@@ -112,6 +113,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setColumnName(String name) {
_columnName = name;
}
+
public String columnName() {
if (_columnName != null)
return _columnName;
@@ -124,6 +126,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setClassName(String name) {
_className = name;
}
+
public String className() {
if (_className != null)
return _className;
@@ -137,6 +140,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
_definition = def;
_columnName = null;
}
+
public String definition() {
if (_definition != null)
return _definition;
@@ -149,6 +153,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setExternalType(String type) {
_externalType = type;
}
+
public String externalType() {
if (_externalType != null)
return _externalType;
@@ -162,6 +167,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
_allowsNull = flag;
_has_allowsNull = true;
}
+
public boolean allowsNull() {
if (_has_allowsNull)
return _allowsNull;
@@ -173,6 +179,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setReadOnly(boolean flag) {
_readOnly = flag;
}
+
public boolean readOnly() {
return _readOnly;
}
@@ -184,6 +191,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
else
_prototypeName = null;
}
+
public EOAttribute prototype() {
if (_prototypeName != null && _prototype == null) {
try {
@@ -202,6 +210,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setPrecision(int value) {
_precision = value;
}
+
public int precision() {
if (_precision > 0)
return _precision;
@@ -213,6 +222,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setScale(int value) {
_scale = value;
}
+
public int scale() {
if (_scale > 0)
return _scale;
@@ -224,10 +234,11 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setWidth(int value) {
_width = value;
}
+
public int width() {
if (_width > 0)
return _width;
- if (prototype() != null)
+ if (prototype() != null)
return _prototype.width();
return _width;
}
@@ -236,6 +247,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setValueClassName(String name) {
setClassName(name);
}
+
/** @deprecated Use className() instead. */
public String valueClassName() {
return className();
@@ -244,6 +256,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setValueType(String type) {
_valueType = type;
}
+
public String valueType() {
if (_valueType != null)
return _valueType;
@@ -255,6 +268,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setReadFormat(String value) {
_readFormat = value;
}
+
public String readFormat() {
return _readFormat;
}
@@ -262,6 +276,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setWriteFormat(String value) {
_writeFormat = value;
}
+
public String writeFormat() {
return _writeFormat;
}
@@ -270,9 +285,11 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
return (definition() != null);
}
- /** Determines whether the receiver is a flattened attribute.
- * A flattened attribute has as its definition a relationship
- * path that can be resolved to an attribute.
+ /**
+ * Determines whether the receiver is a flattened attribute. A flattened
+ * attribute has as its definition a relationship path that can be resolved to
+ * an attribute.
+ *
* @return true if the receiver is flattened.
*/
public boolean isFlattened() {
@@ -292,6 +309,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setParameterDirection(int dir) {
_parameterDirection = dir;
}
+
public int parameterDirection() {
return _parameterDirection;
}
@@ -305,6 +323,7 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
public void setUserInfo(NSDictionary value) {
_userInfo = value;
}
+
public NSDictionary userInfo() {
return _userInfo;
}
@@ -348,34 +367,31 @@ public class EOAttribute extends EOProperty implements EOPropertyListEncoding {
}
/*
- * $Log$
- * Revision 1.2 2006/02/16 16:47:13 cgruber
- * Move some classes in to "internal" packages and re-work imports, etc.
+ * $Log$ Revision 1.2 2006/02/16 16:47:13 cgruber Move some classes in to
+ * "internal" packages and re-work imports, etc.
*
- * Also use UnsupportedOperationExceptions where appropriate, instead of WotonomyExceptions.
+ * Also use UnsupportedOperationExceptions where appropriate, instead of
+ * WotonomyExceptions.
*
- * Revision 1.1 2006/02/16 13:19:57 cgruber
- * Check in all sources in eclipse-friendly maven-enabled packages.
+ * Revision 1.1 2006/02/16 13:19:57 cgruber Check in all sources in
+ * eclipse-friendly maven-enabled packages.
*
- * Revision 1.7 2003/08/14 02:13:56 chochos
- * implement and use _attributeForPath()
+ * Revision 1.7 2003/08/14 02:13:56 chochos implement and use
+ * _attributeForPath()
*
- * Revision 1.6 2003/08/12 01:45:04 chochos
- * added some code to handle prototypes
+ * Revision 1.6 2003/08/12 01:45:04 chochos added some code to handle prototypes
*
- * Revision 1.5 2003/08/11 19:38:27 chochos
- * Can now read from a file and re-write to another file.
+ * Revision 1.5 2003/08/11 19:38:27 chochos Can now read from a file and
+ * re-write to another file.
*
- * Revision 1.4 2003/08/09 01:35:35 chochos
- * implement EOPropertyListEncoding
+ * Revision 1.4 2003/08/09 01:35:35 chochos implement EOPropertyListEncoding
*
- * Revision 1.3 2003/08/08 06:52:09 chochos
- * isFlattened() works
+ * Revision 1.3 2003/08/08 06:52:09 chochos isFlattened() works
*
- * Revision 1.2 2003/08/08 02:15:03 chochos
- * added parameterDirection (for use with stored procedures)
+ * Revision 1.2 2003/08/08 02:15:03 chochos added parameterDirection (for use
+ * with stored procedures)
*
- * Revision 1.1 2003/08/07 02:39:45 chochos
- * EOAttribute. Can be initialized from a property list.
+ * Revision 1.1 2003/08/07 02:39:45 chochos EOAttribute. Can be initialized from
+ * a property list.
*
-*/ \ No newline at end of file
+ */ \ No newline at end of file