Oracle field defaults not getting picked up

3 posts, 0 answers
  1. Corey
    Corey avatar
    6 posts
    Member since:
    Jun 2012

    Posted 05 Jun 2012 Link to this post

    I have a schema in Oracle that has a CreatedDate field with a default value of SYSDATE.  When I build my model and save a record without specifying a value for the CreatedDate field, the default value is not used.  I worked around this by setting the Kind to PersistReadOnly, but then I can never override a default value. I would think that the model builder would pick up that there is a default value setup in the DB and use it to initialize the value but let me set it explicitly if I need or want to.  For instance, I've got a field called Valid that defaults to 'X' if validation hasn't been performed, then in my code I can set it to 'Y' or 'N' later when I run my validation routine.  Would that situation have a workaround where the initial save would write the 'X' to the table and later allow me to edit that field?

    Oracle 11g, .Net 4.0, VS 2010, ORM 2012.1.301.2.

    Thanks in advance,
    Corey
  2. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 06 Jun 2012 Link to this post

    Hello Corey,

    The default values support was introduced in the latest internal build of the product – Telerik OpenAccess ORM 2012.1.427.1.

    Hope that helps. If any other questions arise, do not hesitate to contact us back.

    Regards,

    Damyan Bogoev
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
  3. DevCraft banner
  4. Corey
    Corey avatar
    6 posts
    Member since:
    Jun 2012

    Posted 06 Jun 2012 Link to this post

    Thanks Damyan for the quick response.  I think I'll hold off and update to the Q2 release.  It's goof to know the issue is fixed, though.

    Thanks again,
    Corey
Back to Top