This module is view-only. You do not have an enrolement for this module.

Creating collections

This is a nice easy one, just use the @MakeCollection annotation. Its up to you to ensure that an object created with @MakeCollection is actually a collection in the sense that it has a corresponding @ChildrenOf method. If not ... strange things might happen.

    public Musician createAndSaveMusician(MusiciansController root, String newName) {
        Transaction tx = SessionManager.session().beginTransaction();
        Musician m = new Musician();
        m.setCreatedDate(new Date());
        m.setModifiedDate(new Date());
        return m;


See MusiciansController for full source code