Uploaded image for project: 'Tupelo'
  1. Tupelo
  2. TUP-267

One stop save and register

XMLWordPrintableJSON

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Beans
    • None

      Rather than have a two-stage

      register(subject, bean);
      save(subject);

      One stop shopping like

      registerAndSave(subject, bean);

      This would have to

      1. check the likely mapping for the bean. If it has a subject property and that conflicts with the given subject, throw an exception. otherwise register (if needed) and save.
      2. if no subject property, check that the bean is not registered. If it is, check that it is registered with the given subject. If not, throw an exception. If so save.

      Possibly have the following call too

      Resource regsiterAndSave(Object bean);

      which would return the subject used, conforming to the usual contract for register (find the subject if there is a subject property, create a random one if not)

      Next people will want mapAndRegisterAndSave at this rate...

              jgaynor Jeffrey Gaynor
              jgaynor Jeffrey Gaynor
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: