Package org.damour.base.client.objects

Examples of org.damour.base.client.objects.TagMembership


    Session session = HibernateUtil.getInstance().getSession();
    Transaction tx = session.beginTransaction();

    List<Tag> tags = TagHelper.getTags(session);
    for (Tag tag : tags) {
      TagMembership tagMem = new TagMembership();
      tagMem.setTag(tag);
      PermissibleObject obj = new PermissibleObject();
      obj.setName("tagMembership aware");
      session.save(obj);
      tagMem.setPermissibleObject(obj);
      session.save(tagMem);
      System.out.println(tag.getName());
    }

    tx.commit();
View Full Code Here


    Session session = HibernateUtil.getInstance().getSession();

    List<Tag> tags = TagHelper.getTags(session);
    for (Tag tag : tags) {
      Transaction tx = session.beginTransaction();
      TagMembership tagMem = new TagMembership();
      tagMem.setTag(tag);
      PermissibleObject obj = new PermissibleObject();
      obj.setName("tagMembership aware");
      session.save(obj);
      tagMem.setPermissibleObject(obj);
      session.save(tagMem);
      tx.commit();

      tx = session.beginTransaction();
      session.delete(tagMem);
View Full Code Here

    Transaction tx = session.beginTransaction();

    Tag tag = createTag("to-be-deleted-parent", "desc1", null);
    Tag tag2 = createTag("to-be-deleted-child", "desc2", tag);

    TagMembership tagMem = new TagMembership();
    tagMem.setTag(tag);
    PermissibleObject obj = new PermissibleObject();
    obj.setName("tags for this should not exist");
    session.save(obj);
    tagMem.setPermissibleObject(obj);
    session.save(tagMem);
    session.save(tag);
    session.save(tag2);

    tx.commit();
View Full Code Here

    // anyone can get tags
    return TagHelper.getTags(session.get());
  }

  public void addToTag(final Tag tag, final PermissibleObject permissibleObject) throws SimpleMessageException {
    TagMembership tagMembership = new TagMembership();
    tagMembership.setTag(tag);
    tagMembership.setPermissibleObject(permissibleObject);
    addToTag(tagMembership);
  }
View Full Code Here

      throw new SimpleMessageException("PermissibleObject not found: " + permissibleObject);
    }

    Transaction tx = session.get().beginTransaction();
    try {
      TagMembership cm = TagHelper.getTagMembership(session.get(), hibTag, permissibleObject);
      session.get().delete(cm);
      tx.commit();
    } catch (Throwable t) {
      Logger.log(t);
      try {
View Full Code Here

TOP

Related Classes of org.damour.base.client.objects.TagMembership

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.