|
From: <tri...@us...> - 2007-12-12 14:28:01
|
Revision: 199
http://equanda.svn.sourceforge.net/equanda/?rev=199&view=rev
Author: triathlon98
Date: 2007-12-12 06:27:54 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
EQ-102 auto mark reference and description fields
Modified Paths:
--------------
trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java
Modified: trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java
===================================================================
--- trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java 2007-12-12 13:57:17 UTC (rev 198)
+++ trunk/equanda-generate/src/main/java/org/equanda/persistence/xml/OMField.java 2007-12-12 14:27:54 UTC (rev 199)
@@ -287,8 +287,6 @@
"Field " + getParentName() + '.' + value +
" - invalid fieldname, should not start with \"equanda\" or \"UOID\" or \"_\"" );
}
- if ( "reference".equalsIgnoreCase( val ) ) fieldReference = true;
- if ( "description".equalsIgnoreCase( val ) ) fieldDescription = true;
}
else if ( name.equals( "singular" ) )
{
@@ -1519,6 +1517,9 @@
// do some basic validation, only done at this point because base type replacement needs to be done
doValidation();
+ if ( "reference".equalsIgnoreCase( name ) && ( isString() || isClob() ) ) fieldReference = true;
+ if ( "description".equalsIgnoreCase( name ) && ( isString() || isClob() ) ) fieldDescription = true;
+
if ( type == TYPE_LINK )
{
// if this field is a link, check that the linked table exists (and is root)
@@ -1692,17 +1693,13 @@
if ( sroot != null ) sroot.addSuggestSelect( suggest.getField() );
}
}
- if ( !isString() && ( ( isReference() || isDescription() ) ) )
+ if ( !(isString() || isClob()) && ( ( isReference() || isDescription() ) ) )
{
- err( "is not a string field, so it cannot be a reference or description field" );
+ err( "only string or clob fields can be is-reference or is-description" );
}
- if ( isLink() && ( isReference() || isDescription() ) )
- {
- err( "is a link field, so it cannot be a reference or description field" );
- }
if ( isCalculated() && ( isReference() || isDescription() ) )
{
- err( "is a calculated field, so it cannot be a reference or description field" );
+ err( "is a calculated field, so it cannot is-reference or is-description" );
}
if ( hasMutableEvenIf() )
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|