Tabnine Logo
DomainClass
Code IndexAdd Tabnine to your IDE (free)

How to use
DomainClass
in
pt.ist.fenixframework.dml

Best Java code snippets using pt.ist.fenixframework.dml.DomainClass (Showing top 20 results out of 315)

origin: fenix-framework/fenix-framework

public final String getSetterDAPStatement(DomainClass domainClass, String slotName, String typeName) {
  //System.out.println("\tGenerating setter DAP statement for " + domainClass.getFullName() + "."  + slotName + " of type " + typeName);
  if (DAP_ENABLED) {
    return "pt.ist.dap.implementation.simple.SimpleContextManager.updateWriteStatisticsWithoutContext(\""
        + domainClass.getFullName() + "\", \"" + slotName + "\");";
  } else {
    return "";
  }
}
origin: fenix-framework/fenix-framework

/**
 * @return the {@link DomainMetaClass} of the superclass of the metaClass
 *         passed as argument
 */
private DomainMetaClass getDomainMetaSuperclassFromDML(DomainMetaClass metaClass) {
  try {
    DomainClass dmlDomainSuperclass =
        (DomainClass) existingDMLDomainClasses.get(metaClass.getDomainClass()).getSuperclass();
    Class<? extends DomainObject> domainSuperclass =
        (Class<? extends DomainObject>) Class.forName(dmlDomainSuperclass.getFullName());
    return existingDomainMetaClasses.get(domainSuperclass);
  } catch (ClassNotFoundException e) {
    e.printStackTrace();
    throw new Error(e);
  }
}
origin: fenix-framework/fenix-framework

protected void generateOneClass(final DomainClass domClass) {
  final String packageName = domClass.getPackageName();
  writeToFile(new File(getBaseDirectoryFor(packageName), domClass.getBaseName() + ".java"), new WriteProcedure() {
    @Override
    public void doIt(PrintWriter out) {
      generateFilePreamble(packageName, out);
      generateBaseClass(domClass, out);
    }
  });
  // don't generate non-base classes for an external definition.
  if (compArgs.isExternalDefinition(domClass.getSourceFile())) {
    return;
  }
  File leafClassFile = new File(getDirectoryFor(packageName), domClass.getName() + ".java");
  if (!leafClassFile.exists()) {
    writeToFile(leafClassFile, new WriteProcedure() {
      @Override
      public void doIt(PrintWriter out) {
        generatePublicFilePreamble(packageName, out);
        generatePublicClass(domClass, out);
      }
    });
  }
}
origin: fenix-framework/fenix-framework

public static String getExpectedTableName(final DomainClass domainClass) {
  if (domainClass.getSuperclass() == null) {
    return getTableName(domainClass.getName());
  }
  return domainClass.getSuperclass() instanceof DomainClass ? getExpectedTableName((DomainClass) domainClass
      .getSuperclass()) : null;
}
origin: fenix-framework/fenix-framework

protected void ormBeginBaseClass(DomainClass domClass) {
  this.ormSlots = new ArrayList<String>();
  this.ormSlotsForRelationToOne = new ArrayList<String>();
  this.ormRoleManyToOne = new ArrayList<Role>();
  this.ormRoleOneToMany = new ArrayList<Role>();
  // this.ormRoleOneToOne = new ArrayList<Role>();
  this.ormRoleManyToMany = new ArrayList<Role>();
  this.ormTransientSlots = new ArrayList<String>();
  StringBuilder buf = new StringBuilder();
  buf.append("    <mapped-superclass class=\"");
  buf.append(domClass.getPackageName());
  buf.append(".");
  buf.append(domClass.getBaseName());
  buf.append("\" metadata-complete=\"false\">\n");
  buf.append("        <attributes>\n");
  this.ormWriter.print(buf.toString());
}
origin: fenix-framework/fenix-framework

Iterator<Role> roleSlots = dClass.getRoleSlots();
while (roleSlots.hasNext()) {
  Role role = roleSlots.next();
        ClassDescriptor otherClassDescriptor = ojbMetadata.get(((DomainClass) role.getType()).getFullName());
          logger.warn("Ignoring {}", ((DomainClass) role.getType()).getFullName());
          continue;
domEntity = dClass.getSuperclass();
origin: fenix-framework/fenix-framework

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());
        }
      }
    }
  }
}
origin: fenix-framework/fenix-framework

protected static void updateFields(final DomainModel domainModel, final ClassDescriptor classDescriptor,
    final DomainClass domClass, final Map<String, ClassDescriptor> ojbMetadata, final Class<?> persistentFieldClass)
    throws Exception {
  DomainEntity domEntity = domClass;
  int fieldID = 1;
  addPrimaryFieldDescriptor(domainModel, "oid", "long", fieldID++, classDescriptor, persistentFieldClass);
  // write the domainMetaObject for all domain objects
  addFieldDescriptor(domainModel, "oidDomainMetaObject", "Long", fieldID++, classDescriptor, persistentFieldClass);
  while (domEntity instanceof DomainClass) {
    DomainClass dClass = (DomainClass) domEntity;
    Iterator<Slot> slots = dClass.getSlots();
    while (slots.hasNext()) {
      Slot slot = slots.next();
      String slotName = slot.getName();
      String slotType = slot.getSlotType().getDomainName();
      addFieldDescriptor(domainModel, slotName, slotType, fieldID++, classDescriptor, persistentFieldClass);
    }
    for (Role role : dClass.getRoleSlotsList()) {
      String roleName = role.getName();
      if ((role.getMultiplicityUpper() == 1) && (roleName != null)) {
        String foreignOidField = "oid" + StringUtils.capitalize(roleName);
        addFieldDescriptor(domainModel, foreignOidField, "Long", fieldID++, classDescriptor, persistentFieldClass);
      }
    }
    domEntity = dClass.getSuperclass();
  }
}
origin: fenix-framework/fenix-framework

private boolean hasSuperclass(DomainEntity domainEntity) {
  return domainEntity != null && domainEntity instanceof DomainClass
      && ((DomainClass) domainEntity).getSuperclass() != null;
}
origin: fenix-framework/fenix-framework

print(out, "protected static class DO_State extends ");
String superclassName = getEntityFullName(domClass.getSuperclass());
printWords(out, superclassName == null ? getDomainClassRoot() : superclassName);
print(out, ".DO_State");
onNewline(out);
for (Slot slot : domClass.getSlotsList()) {
  generateSlotDeclaration(out, slot.getTypeName(), slot.getName());
for (Role role : domClass.getRoleSlotsList()) {
  if (role.getName() != null && role.getMultiplicityUpper() == 1) {
    generateSlotDeclaration(out, getTypeFullName(role.getType()), role.getName());
println(out, "super.copyTo(newState);");
println(out, "DO_State newCasted = (DO_State)newState;");
for (Slot slot : domClass.getSlotsList()) {
  printWords(out, "newCasted." + slot.getName(), "=", "this." + slot.getName());
  println(out, ";");
for (Role role : domClass.getRoleSlotsList()) {
  if (role.getName() != null && role.getMultiplicityUpper() == 1) {
    printWords(out, "newCasted." + role.getName(), "=", "this." + role.getName());
origin: fenix-framework/fenix-framework

protected void generateDatabaseReader(DomainClass domClass, PrintWriter out) {
  newline(out);
  printMethod(out, "protected", "void", "readSlotsFromResultSet", makeArg("java.sql.ResultSet", "rs"),
      makeArg("int", "txNumber"));
  print(out, " throws java.sql.SQLException");
  startMethodBody(out);
  if (domClass.hasSuperclass()) {
    println(out, "super.readSlotsFromResultSet(rs, txNumber);");
  }
  for (Slot slot : domClass.getSlotsList()) {
    generateOneSlotRsReader(out, slot.getName(), slot.getSlotType());
  }
  for (Role role : domClass.getRoleSlotsList()) {
    if (role.getName() != null && role.getMultiplicityUpper() == 1) {
      generateOneRoleSlotRsReader(out, role.getName());
    }
  }
  endMethodBody(out);
}
origin: fenix-framework/fenix-framework

protected void generateBaseClass(DomainClass domClass, PrintWriter out) {
  newline(out);
  println(out, "@SuppressWarnings(\"all\")");
  // This should be the other way around, but that would cause API disruption
  String modifier = domClass.hasModifier(Modifier.PROTECTED) ? "" : "public";
  printWords(out, modifier, "abstract", "class", domClass.getBaseName(), "extends");
  String superclassName = getEntityFullName(domClass.getSuperclass());
  printWords(out, (superclassName == null) ? getDomainClassRoot() : superclassName);
  final List interfacesNames = domClass.getInterfacesNames();
  if (interfacesNames != null && !interfacesNames.isEmpty()) {
    printWords(out, "implements");
    for (final Object ifsn : interfacesNames) {
      printWords(out, ifsn.toString());
    }
  }
  newBlock(out);
  generateBaseClassBody(domClass, out);
  closeBlock(out);
}
origin: fenix-framework/fenix-framework

@Override
protected void generateInitInstanceMethodBody(DomainClass domClass, PrintWriter out) {
  // smf: this method restores the behavior by default in CodeGenerator, undoing what JVSTMCodeGenerator does.  If, as
  // expected, the generation of slot and roleSlots is all moved to the CodeGenerator, then this code may be deleted.
  onNewline(out);
  for (Role role : domClass.getRoleSlotsList()) {
    if (role.getName() != null) {
      generateInitRoleSlot(role, out);
    }
  }
}
origin: fenix-framework/fenix-framework

protected void generateBaseClassBody(DomainClass domClass, PrintWriter out) {
  comment(out, "Static Slots");
  generateStaticSlots(domClass, out);
  newline(out);
  if (!isDefaultCodeGenerator()) {
    comment(out, "Slots");
    generateSlots(domClass.getSlots(), out);
    newline(out);
    comment(out, "Role Slots");
    generateRoleSlots(domClass.getRoleSlots(), out);
    newline(out);
    comment(out, "Init Instance");
    generateInitInstance(domClass, out);
    newline(out);
  }
  comment(out, "Constructors");
  printMethod(out, "protected", "", domClass.getBaseName());
  startMethodBody(out);
  generateBaseClassConstructorsBody(domClass, out);
  endMethodBody(out);
  newline(out);
  comment(out, "Getters and Setters");
  generateSlotsAccessors(domClass, out);
  newline(out);
  comment(out, "Role Methods");
  generateRoleSlotsMethods(domClass.getRoleSlots(), out);
  newline(out);
  // comment(out, "Slot Consistency Predicates");
  // generateSlotConsistencyPredicates(domClass, out);
}
origin: fenix-framework/fenix-framework

protected void generateInitInstanceMethodBody(DomainClass domClass, PrintWriter out) {
  println(out, "super.init$Instance(allocateOnly);");
  for (Slot slot : domClass.getSlotsList()) {
    generateInitSlot(slot, out);
  }
  onNewline(out);
  for (Role role : domClass.getRoleSlotsList()) {
    if (role.getName() != null) {
      generateInitRoleSlot(role, out);
    }
  }
}
origin: fenix-framework/fenix-framework

@Override
protected void generateBaseClassBody(DomainClass domClass, PrintWriter out) {
  generateStaticSlots(domClass, out);
  newline(out);
  generateSlots(domClass.getSlots(), out);
  newline(out);
  generateRoleSlots(domClass.getRoleSlots(), out);
  generateInitInstance(domClass, out);
  generateDefaultConstructor(domClass, out);
  generateSlotsAccessors(domClass, out);
  generateRoleSlotsMethods(domClass.getRoleSlots(), out);
}
origin: fenix-framework/fenix-framework

protected void generatePublicClass(DomainClass domClass, PrintWriter out) {
  String leafClassName = domClass.getName();
  // This should be the other way around, but that would cause API disruption
  String modifier = domClass.hasModifier(Modifier.PROTECTED) ? "" : "public";
  printWords(out, modifier, "class", leafClassName, "extends", domClass.getBaseName());
  newBlock(out);
  generatePublicClassConstructors(leafClassName, out);
  closeBlock(out);
}
origin: fenix-framework/fenix-framework

protected void generateStaticSlots(DomainClass domClass, PrintWriter out) {
  Iterator roleSlotsIter = domClass.getRoleSlots();
  if (!isDefaultCodeGenerator()) {
    while (roleSlotsIter.hasNext()) {
      Role role = (Role) roleSlotsIter.next();
      if (role.getName() != null) {
        generateStaticRoleSlots(role, out);
      }
    }
  }
  roleSlotsIter = domClass.getRoleSlots();
  while (roleSlotsIter.hasNext()) {
    Role role = (Role) roleSlotsIter.next();
    if (role.getName() != null) {
      generateStaticRelationSlots(role, out);
      if (!isDefaultCodeGenerator()) {
        generateStaticKeyFunctionForRole(role, out);
      }
    }
  }
}
origin: fenix-framework/fenix-framework

protected void generateCheckDisconnected(DomainClass domClass, PrintWriter out) {
  newline(out);
  printMethod(out, "protected", "void", "checkDisconnected");
  startMethodBody(out);
  if (domClass.hasSuperclass()) {
    println(out, "super.checkDisconnected();");
  }
  println(out, "DO_State castedState = (DO_State)this.get$obj$state(false);");
  Iterator<Role> roleSlotsIter = domClass.getRoleSlots();
  while (roleSlotsIter.hasNext()) {
    Role role = roleSlotsIter.next();
    if (role.getName() != null) {
      onNewline(out);
      print(out, "if (");
      if (role.getMultiplicityUpper() == 1) {
        print(out, "castedState.");
        print(out, role.getName());
        print(out, " != null");
      } else {
        print(out, "get$rl$");
        print(out, role.getName());
        print(out, "().size() > 0");
      }
      print(out, ") handleAttemptToDeleteConnectedObject(\"");
      print(out, capitalize(role.getName()));
      println(out, "\");");
    }
  }
  endMethodBody(out);
}
origin: fenix-framework/fenix-framework

protected void generateDefaultConstructor(DomainClass domClass, PrintWriter out) {
  printConstructor(out, "public", domClass.getBaseName());
  startMethodBody(out);
  generateBaseClassConstructorsBody(domClass, out);
  endMethodBody(out);
}
pt.ist.fenixframework.dmlDomainClass

Most used methods

  • getFullName
  • getSuperclass
  • getRoleSlotsList
  • getRoleSlots
  • getBaseName
  • getName
  • getSlots
  • getSlotsList
  • getPackageName
  • <init>
  • addSlot
  • findRoleSlot
  • addSlot,
  • findRoleSlot,
  • findSlot,
  • getInterfacesNames,
  • getSourceFile,
  • hasModifier,
  • hasSlotWithOption,
  • hasSuperclass

Popular in Java

  • Making http requests using okhttp
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • setContentView (Activity)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JList (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now