protected void checkForRepeatedSlots() {
    for (DomainClass domClass : classes.values()) {
      DomainEntity superDomClass = domClass.getSuperclass();
      if (superDomClass != null) {
        for (Slot slot : domClass.getSlotsList()) {
          if (superDomClass.findSlot(slot.getName()) != null) {
            System.err.printf(
                "WARNING: Slot named '%s' in class '%s' already exists in a superclass\n",
                slot.getName(), domClass.getName());
          }
          if (superDomClass.findRoleSlot(slot.getName()) != null) {
            System.err.printf(
                "WARNING: Slot named '%s' in class '%s' already exists in a superclass as role slot\n",
                slot.getName(), domClass.getName());
          }
        }

        for (Role role : domClass.getRoleSlotsList()) {
          if (superDomClass.findSlot(role.getName()) != null) {
            System.err.printf(
                "WARNING: Role slot named '%s' in class '%s' already exists in a superclass as a slot\n",
                role.getName(), domClass.getName());
          }

          if (superDomClass.findRoleSlot(role.getName()) != null) {
            System.err.printf(
                "WARNING: Role slot named '%s' in class '%s' already exists in a superclass as role slot\n",
                role.getName(), domClass.getName());
          }
        }
      }
    }
  }
Ejemplo n.º 2
0
 public void testHashing() {
   DomainEntity gde = new DomainEntity();
   gde.setDomainFQDN("com.example");
   gde.setDomaintype(DomainType.Type.APPLICATION);
   gde.setDescription("This is a test company");
   this.entity = gde;
   this.create();
 }
Ejemplo n.º 3
0
 @TransactionAttribute(TransactionAttributeType.REQUIRED)
 public void createNewApplicationDomain(String domainName, DomainGroupEntity dge) {
   DomainEntity de =
       EntityBuilder.of()
           .DomainEntity()
           .setDomainFQDN(domainName)
           .setDomaintype(DomainType.Type.APPLICATION);
   // domain space key and domain name of entity are same
   de.insertNewGroup(domainName, dge);
   this.setEntity(de);
   // this.create();
 }