Issue Details (XML | Word | Printable)

Key: GDS-398
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Franck Wolff
Reporter: Edward Yakop
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
GraniteDS

Gas3: granite-generator to support uid for @ExternalizedProperty

Created: 15/Apr/09 11:37 AM   Updated: 15/Apr/09 04:44 PM   Resolved: 15/Apr/09 04:44 PM
Component/s: AS3 code generation, Granite Eclipse Builder
Affects Version/s: None
Fix Version/s: 2.0.0_RC1


 Description  « Hide
If my java bean has uid defined like:

[Code]
public class MyEntity
{
   @ExternalizedProperty
   public String getUid()
   {
      ...
   }
}
[/Code]

Granite-generator must recognized getUID property as uid for MyEntity class.

Edward Yakop added a comment - 15/Apr/09 12:26 PM
Apologies for not providing patch. I checked out graniteds_builder with git svn command.

JavaBean.java
Line 57:
    protected final JavaProperty uid;

Line 88:
        // Find uid (if any).
        JavaProperty tmpUid = null;
        for (JavaProperty property : properties.values()) {
                if (tmpUid == null && provider.isUid(property))
                    tmpUid = property;
            }
        }
        this.uid = tmpUid;

JavaTypeProperty.java
Line 41:
public boolean isUid(JavaProperty fieldProperty);

JavaAs3GroovyTransformer.java
Line 316:
public boolean isUid(JavaProperty fieldProperty) {
     return getConfig().getUid() == null
? "uid".equals(fieldProperty.getName())
: getConfig().getUid().equals(fieldProperty.getName());
}

Franck Wolff added a comment - 15/Apr/09 04:44 PM
Done (thanks!)