Hello,

the generated ActionBase, ValidatorBase  classes has compile error if model
has primitive types (int, long, float). If I use Integer, Long, Float then
Validator is Ok, but Actions not.

1. Type mismatch: cannot convert from int/float/long to String
2. The operator == is undefined for the argument type(s) int/float/long,
null

Example:

Model

                Entity Ausgabe {
                  scaffold
                  Date datum
                  float betrag
                  - @AusgabenZweck zweck
                  - @Mitarbeiter mitarbeiter <-> ausgaben
                }


......
public class UpdateAusgabeValidatorBase implements Validator {

...
    public void validateAusgabe(UpdateAusgabeForm form, Errors errors) {
        if (form.getDatum() == null) {
            errors.rejectValue("datum", "required");
        }

        if (form.getBetrag() == null) {  // form.getBetrag() is a float
value!
            errors.rejectValue("betrag", "required");
        }
    }
}
....


        ValueObject Note {
                Date datum
                float note
          - @Fach fach
        }


        Entity Fach {
        scaffold
          float gebuehr
          - @Bezeichnung bezeichnung
          - @Schuljahr schuljahr <-> faecher
          - @Mitarbeiter lehrer
          - List<@Termin> termine
          - List<@Gruppe> gruppen <-> faecher
        }





public class CreateNoteActionBase extends FormAction {
....

    protected List<SelectItem> getFachItems() {
        Collection<Fach> fach =
fachService.findAll(ServiceContextStore.get());
        List<SelectItem> items = new ArrayList<SelectItem>();
        for (Fach fachItem : fach) {
            if (fachItem instanceof Fach) {
                String label = fachItem.getGebuehr(); // 
fachItem.getGebuehr() is float

                items.add(new SelectItem(fachItem.getId(), label));
            }
        }
        return items;
    }

-- 
View this message in context: 
http://www.nabble.com/JSF%3A-Generated-ActionBase-and-ValidatorBase-classes---compile--Error-%28Type-mismatch%2C-%3D%3D-is-undefined%29-tp19685911s17564p19685911.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to