Re: NOT NULL fields..

From: Alex Gunawan Wibowo (
Date: Tue Nov 23 2004 - 22:16:55 EST

  • Next message: Andrus Adamchik: "Re: NOT NULL fields.."

    Ok... I've had a little clue...

    I can use the method "isMandatory()" from

    ( the XML mapping file has property "isMandatory"
    I strongly believe means whether that field has the
    attribute "NOT NULL")
    the question now is how do i instantiate this

    I have this snipplet from the web..
            Iterator it = ent.getAttributes().iterator();
            DbAttribute at = (DbAttribute);
    Not too sure about this, but I guess that
    "getAttributes()" is a method from class

    THis is what I think:
     I have to instantiate this Entity class,
     and call it's "setDataMap()" method.
     --> I think setDataMap is setting which XML data
         mapping file.

    Now the problem is, how do i get the DataMapping
    Is it stored somewhere?
    If it has to be read manually everytime, that will
    really really slow down the whole system (parsing XML

    Sorry if this is a bit messy...
    But I hope you get the overall picture..

    Best regards,


    --- Alex Gunawan Wibowo <>

    > Hello,
    > Does anyone know if Cayenne can check if a
    > particular
    > field in a table is required to be filled (i.e. NOT
    > NULL)?
    > I'm developing an application with Struts, and I
    > want
    > this behaviour to check if a particular field has
    > been
    > provided by the user.
    > I can manually code this behaviour by reading a
    > property file.. but that is a bit dirty i would say.
    > (i.e. a change in the database schema would require
    > a
    > change in the property file, etc etc).
    > Thank you very much for the help!
    > Best regards,
    > Alex Wibowo
    > =====
    > Alex Wibowo
    > ~ Second is a failure ~
    > The University of Melbourne
    > Department of Computer Science and Software
    > Engineering
    > Website -
    > Team Wasabi -
    > ==============================================
    > __________________________________
    > Do you Yahoo!?
    > All your favorites on one personal page Try My
    > Yahoo!

    Do you Yahoo!?
    Meet the all-new My Yahoo! - Try it today!

    This archive was generated by hypermail 2.0.0 : Tue Nov 23 2004 - 22:16:59 EST