public static String makeSetter(EStructuralFeature eStructuralFeature) { StringBuilder sb = new StringBuilder(); sb.append("set" + firstLetterUpperCase(eStructuralFeature.getName())); if (eStructuralFeature instanceof EReference && !eStructuralFeature.isMany() && eStructuralFeature.getEAnnotation("embedsreference") == null) { sb.append("Id"); } return sb.toString(); }
public static String makeGetter(EStructuralFeature eStructuralFeature) { StringBuilder sb = new StringBuilder(); if (eStructuralFeature.getEType() == EcorePackage.eINSTANCE.getEBoolean()) { sb.append("is"); } else { sb.append("get"); } sb.append(firstLetterUpperCase(eStructuralFeature.getName())); if (eStructuralFeature instanceof EReference && !eStructuralFeature.isMany() && eStructuralFeature.getEAnnotation("embedsreference") == null) { sb.append("Id"); } return sb.toString(); }
public List<ObjectIdentifier> getOids(EClass eClass, EStructuralFeature eStructuralFeature, Object value, DatabaseInterface databaseInterface, int pid, int rid) throws BimserverDatabaseException { if (eStructuralFeature.getEAnnotation("singleindex") != null) { List<ObjectIdentifier> result = new ArrayList<>(); String indexTableName = eStructuralFeature.getEContainingClass().getEPackage().getName() + "_" + eClass.getName() + "_" + eStructuralFeature.getName();
private void processPossibleIndices(ByteBuffer keyBuffer, int pid, int rid, long oid, EClass eClass, ByteBuffer valueBuffer) throws BimserverLockConflictException, BimserverDatabaseException { boolean hasAtLeastOneIndex = false; for (EStructuralFeature eStructuralFeature : eClass.getEAllStructuralFeatures()) { if (eStructuralFeature.getEAnnotation("singleindex") != null) { hasAtLeastOneIndex = true; break; if (eStructuralFeature.getEAnnotation("singleindex") != null) { String indexTableName = eClass.getEPackage().getName() + "_" + eClass.getName() + "_" + eStructuralFeature.getName(); if (perRecordVersioning && oldData != null) {
out.println("<table>"); for (EStructuralFeature eStructuralFeature : eObject.eClass().getEAllStructuralFeatures()) { if (eStructuralFeature.getEAnnotation("hidden") == null) { out.println("<tr>"); out.println("<td>" + eStructuralFeature.getName() + "</td>");
if (!entityBN.isDerived(eStructuralFeature.getName())) { boolean derived = false; if (eStructuralFeature.getEAnnotation("hidden") != null) { if (eStructuralFeature.getEAnnotation("asstring") == null) { } else { if (entityBN.isDerived(eStructuralFeature.getName().substring(0, eStructuralFeature.getName().length() - 8))) {
if (eStructuralFeature.getEAnnotation("singleindex") != null) { String indexTableName = eClass.getEPackage().getName() + "_" + eClass.getName() + "_" + eStructuralFeature.getName(); try {
if (listObject.eClass().getEAnnotation("wrapped") != null || listObject.eClass().getEStructuralFeature("wrappedValue") != null) { writeWrappedValue(object.getPid(), object.getRid(), listObject, buffer, packageMetaData); } else if (feature.getEAnnotation("twodimensionalarray") != null) { EStructuralFeature lf = listObject.eClass().getEStructuralFeature("List"); writeList(listObject, buffer, packageMetaData, lf); } else if (feature.getEAnnotation("dbembed") != null) { writeEmbeddedValue(object.getPid(), object.getRid(), listObject, buffer, packageMetaData); } else {
protected boolean isInverse(EStructuralFeature eStructuralFeature) throws ObjectIDMException { if (eStructuralFeature instanceof EReference && eStructuralFeature.getEContainingClass().getEAnnotation("wrapped") == null) { if (eStructuralFeature.getEAnnotation("hidden") == null && eStructuralFeature.getEContainingClass().getEAnnotation("hidden") == null) { EntityDefinition entityBN = packageMetaData.getSchemaDefinition().getEntityBN(eStructuralFeature.getEContainingClass().getName()); if (entityBN == null) { throw new ObjectIDMException(eStructuralFeature.getEContainingClass().getName() + " not found"); } Attribute attribute = entityBN.getAttributeBNWithSuper(eStructuralFeature.getName()); return attribute instanceof InverseAttribute; } else { return false; } } return false; }
if (o instanceof VirtualObject) { VirtualObject listObject = (VirtualObject)o; if (feature.getEAnnotation("twodimensionalarray") != null) { Short cid = getDatabaseInterface().getCidOfEClass((EClass) feature.getEType());
if (feature.getEAnnotation("nolazyload") == null) { todoList.add(newObject);
IdEObject referencedObject = (IdEObject) value; EClass referencedClass = referencedObject.eClass(); if (feature.getEAnnotation("dbembed") != null) { writeEmbeddedValue(object.getPid(), object.getRid(), value, buffer, packageMetaData); } else if (referencedClass.getEAnnotation("wrapped") != null) {
list.grow(listSize); for (int i = 0; i < listSize; i++) { if (feature.getEAnnotation("twodimensionalarray") != null) { IdEObjectImpl newObject = createInternal((EClass) feature.getEType(), query); Object result = readList(newObject, originalQueryClass, buffer, model, query, todoList, newObject.eClass().getEStructuralFeature("List"));
if (feature.getEAnnotation("twodimensionalarray") != null) { HashMapVirtualObject newObject = new HashMapVirtualObject(reusable, (EClass) feature.getEType()); EClass eClass = (EClass)feature.getEType();
for (EStructuralFeature eStructuralFeature : eObject.eClass().getEAllStructuralFeatures()) { Object eGet = eObject.eGet(eStructuralFeature); if (eStructuralFeature.getEAnnotation("hidden") == null && !eStructuralFeature.isDerived()) { if (eStructuralFeature instanceof EAttribute) { if (eStructuralFeature.isMany()) {
if (feature.getEAnnotation("dbembed") != null) { newValue = readEmbeddedValue(feature, buffer, referenceClass); } else {
if (feature.getEAnnotation("dbembed") != null) { newValue = readEmbeddedValue(feature, buffer, referenceClass, query); } else {
print("\"_s\":1"); for (EStructuralFeature eStructuralFeature : object.eClass().getEAllStructuralFeatures()) { if (eStructuralFeature.getEAnnotation("nolazyload") == null && (eStructuralFeature.getEAnnotation("hidden") == null || includeHidden)) { if (eStructuralFeature instanceof EReference) { Object value = object.eGet(eStructuralFeature); } else if (o instanceof HashMapVirtualObject) { write((HashMapVirtualObject) o); } else if (eStructuralFeature.getEAnnotation("twodimensionalarray") != null) { EClass type = (EClass) eStructuralFeature.getEType(); EStructuralFeature listFeature = type.getEStructuralFeature("List");
print("\"_s\":1"); for (EStructuralFeature eStructuralFeature : object.eClass().getEAllStructuralFeatures()) { if (eStructuralFeature.getEAnnotation("nolazyload") == null && (eStructuralFeature.getEAnnotation("hidden") == null || includeHidden)) { if (eStructuralFeature instanceof EReference) { Object value = object.eGet(eStructuralFeature); if (ref.getOid() < 0 || eClass.getEAnnotation("wrapped") != null || eStructuralFeature.getEAnnotation("dbembed") != null) { write(ref); } else { print("\"_e" + eStructuralFeature.getName() + "\":"); write(ref); } else if (eStructuralFeature.getEAnnotation("dbembed") != null) { print("\"_e" + eStructuralFeature.getName() + "\":"); writeEmbedded(ref);
public static String getType(EStructuralFeature eStructuralFeature) { boolean embedsReference = eStructuralFeature.getEAnnotation("embedsreference") != null; EClassifier eType = eStructuralFeature.getEType(); if (eStructuralFeature.isMany()) {