Adds the getOpenEngSBModelTail method to the class.
518427
private static void addGetOpenEngSBModelTail(CtClass clazz) throws CannotCompileException, NotFoundException {
        CtClass[] params = generateClassField();
        CtMethod method = new CtMethod(cp.get(List.class.getName()), "getOpenEngSBModelTail", params, clazz);
        StringBuilder body = new StringBuilder();
        body.append(createTrace("Called getOpenEngSBModelTail"))
            .append(String.format("return new ArrayList(%s.values());", TAIL_FIELD));
        method.setBody(createMethodBody(body.toString()));
        clazz.addMethod(method);
    }
857344
public static void addDeclaredMethodsFromInterfaces(ClassNode cNode, Map<String, MethodNode> methodsMap) {
        // add in unimplemented abstract methods from the interfaces
        for (ClassNode iface : cNode.getInterfaces()) {
            Map<String, MethodNode> ifaceMethodsMap = iface.getDeclaredMethodsMap();
            for (Map.Entry<String, MethodNode> entry : ifaceMethodsMap.entrySet()) {
                String methSig = entry.getKey();
                if (!methodsMap.containsKey(methSig)) {
                    methodsMap.put(methSig, entry.getValue());
                }
            }
        }
    }
212980
public EKBCommit addInsert(Object insert) {
        if (insert != null) {
            checkIfModel(insert);
            inserts.add((OpenEngSBModel) insert);
        }
        return this;
    }
1325580
public void addStubMethods(TypeSpec.Builder classBuilder) {

        MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder("onTransact")
                .addModifiers(Modifier.PUBLIC)
                .addAnnotation(Override.class)
                .returns(boolean.class)
                .addException(ClassName.get("android.os", "RemoteException"))
                .addParameter(int.class, "code")
                .addParameter(ClassName.get("android.os", "Parcel"), "data")
                .addParameter(ClassName.get("android.os", "Parcel"), "reply")
                .addParameter(int.class, "flags");

        methodBuilder.beginControlFlow("try");
        methodBuilder.beginControlFlow("switch (code)");

        methodBuilder.beginControlFlow("case INTERFACE_TRANSACTION:");
        methodBuilder.addStatement("reply.writeString(DESCRIPTOR)");
        methodBuilder.addStatement("return true");
        methodBuilder.endControlFlow();

        processRemoterElements(classBuilder, new ElementVisitor() {
            @Override
            public void visitElement(TypeSpec.Builder classBuilder, Element member, int methodIndex, MethodSpec.Builder methodBuilder) {
                addStubMethods(classBuilder, member, methodIndex, methodBuilder);
            }
        }, methodBuilder);


        methodBuilder.beginControlFlow("case TRANSACTION__getStubID:");
        methodBuilder.addStatement("data.enforceInterface(DESCRIPTOR)");
        methodBuilder.addStatement("reply.writeNoException()");
        methodBuilder.addStatement("reply.writeInt(serviceImpl.hashCode())");
        methodBuilder.addStatement("return true");
        methodBuilder.endControlFlow();


        //end switch
        methodBuilder.endControlFlow();
        //end of try
        methodBuilder.endControlFlow();
        //catch rethrow
        methodBuilder.beginControlFlow("catch ($T re)", Throwable.class);
        methodBuilder.beginControlFlow("if ((flags & FLAG_ONEWAY) == 0)");
        methodBuilder.addStatement("reply.setDataPosition(0)");
        methodBuilder.addStatement("reply.writeInt(REMOTER_EXCEPTION_CODE)");
        methodBuilder.addStatement("reply.writeString(re.getMessage())");
        methodBuilder.addStatement("reply.writeSerializable(re)");
        methodBuilder.endControlFlow();
        methodBuilder.beginControlFlow("else");
        methodBuilder.addStatement("$T.w(serviceImpl.getClass().getName(), \"Binder call failed.\", re)", ClassName.get("android.util", "Log"));
        methodBuilder.endControlFlow();
        methodBuilder.addStatement("return true");
        methodBuilder.endControlFlow();
        methodBuilder.addStatement("return super.onTransact(code, data, reply, flags)");
        classBuilder.addMethod(methodBuilder.build());
        addCommonExtras(classBuilder);

        addStubExtras(classBuilder);

    }
610950
public void addEngine(ReqMethod method, LinkedEngine engine) {
        for (ReqMethod md : method.parse()) {
            LinkedEngine[] methodEngines = engines[md.ordinal()];
            if (methodEngines.length == 0) {
                methodEngines = new LinkedEngine[] { engine };
            } else {
                methodEngines = Arrays.copyOf(methodEngines, methodEngines.length + 1);
                methodEngines[methodEngines.length - 1] = engine;
            }
            engines[md.ordinal()] = methodEngines;
            engineCount++;
        }
        clearCache();
    }
1068324
public static <T> T createModel(Class<T> model, List<OpenEngSBModelEntry> entries) {
        if (!ModelWrapper.isModel(model)) {
            throw new IllegalArgumentException("The given class is no model");
        }
        try {
            T instance = model.newInstance();
            for (OpenEngSBModelEntry entry : entries) {
                if (tryToSetValueThroughField(entry, instance)) {
                    continue;
                }
                if (tryToSetValueThroughSetter(entry, instance)) {
                    continue;
                }
                ((OpenEngSBModel) instance).addOpenEngSBModelEntry(entry);
            }
            return instance;
        } catch (InstantiationException e) {
            LOGGER.error("InstantiationException while creating a new model instance.", e);
        } catch (IllegalAccessException e) {
            LOGGER.error("IllegalAccessException while creating a new model instance.", e);
        } catch (SecurityException e) {
            LOGGER.error("SecurityException while creating a new model instance.", e);
        }
        return null;
    }
554831
private static CtClass doModelModifications(byte[] byteCode, Version modelVersion, ClassLoader... loaders) {
        if (!initiated) {
            initiate();
        }
        CtClass cc = null;
        LoaderClassPath[] classloaders = new LoaderClassPath[loaders.length];
        try {
            InputStream stream = new ByteArrayInputStream(byteCode);
            cc = cp.makeClass(stream);
            if (!JavassistUtils.hasAnnotation(cc, Model.class.getName())) {
                return null;
            }
            LOGGER.debug("Model to enhance: {}", cc.getName());
            for (int i = 0; i < loaders.length; i++) {
                classloaders[i] = new LoaderClassPath(loaders[i]);
                cp.appendClassPath(classloaders[i]);
            }
            doEnhancement(cc, modelVersion);
            LOGGER.info("Finished model enhancing for class {}", cc.getName());
        } catch (IOException e) {
            LOGGER.error("IOException while trying to enhance model", e);
        } catch (RuntimeException e) {
            LOGGER.error("RuntimeException while trying to enhance model", e);
        } catch (CannotCompileException e) {
            LOGGER.error("CannotCompileException while trying to enhance model", e);
        } catch (NotFoundException e) {
            LOGGER.error("NotFoundException while trying to enhance model", e);
        } catch (ClassNotFoundException e) {
            LOGGER.error("ClassNotFoundException while trying to enhance model", e);
        } finally {
            for (int i = 0; i < loaders.length; i++) {
                if (classloaders[i] != null) {
                    cp.removeClassPath(classloaders[i]);
                }
            }
        }
        return cc;
    }
510
void addMethodInfo(final MethodInfoList methodInfoList, final Map<String, ClassInfo> classNameToClassInfo) {
        for (final MethodInfo mi : methodInfoList) {
            // Index method annotations
            addFieldOrMethodAnnotationInfo(mi.annotationInfo, /* isField = */ false, classNameToClassInfo);

            // Index method parameter annotations
            if (mi.parameterAnnotationInfo != null) {
                for (int i = 0; i < mi.parameterAnnotationInfo.length; i++) {
                    final AnnotationInfo[] paramAnnotationInfoArr = mi.parameterAnnotationInfo[i];
                    if (paramAnnotationInfoArr != null) {
                        for (int j = 0; j < paramAnnotationInfoArr.length; j++) {
                            final AnnotationInfo methodParamAnnotationInfo = paramAnnotationInfoArr[j];
                            final ClassInfo annotationClassInfo = getOrCreateClassInfo(
                                    methodParamAnnotationInfo.getName(), ANNOTATION_CLASS_MODIFIER,
                                    classNameToClassInfo);
                            annotationClassInfo.addRelatedClass(RelType.CLASSES_WITH_METHOD_PARAMETER_ANNOTATION,
                                    this);
                            this.addRelatedClass(RelType.METHOD_PARAMETER_ANNOTATIONS, annotationClassInfo);
                        }
                    }
                }
            }
        }
        if (this.methodInfo == null) {
            this.methodInfo = methodInfoList;
        } else {
            this.methodInfo.addAll(methodInfoList);
        }
    }
136860
def _model_class_from_pk(definition_cls, definition_pk):
    
    try:
        return definition_cls.objects.get(pk=definition_pk).model_class()
    except definition_cls.DoesNotExist:
        pass
774769
function modelExport(m) {
  const result = _.mapValues(m.classes, _.head)
  result[m.__name] = m
  return result
}
985049
private void fillMethods(final SQLiteDaoDefinition currentDaoDefinition, Element daoElement) {
		final One<Boolean> methodWithAnnotation=new One<Boolean>(false);
		
		// create method for dao
		SqlBuilderHelper.forEachMethods((TypeElement) daoElement, new MethodFoundListener() {

			@Override
			public void onMethod(ExecutableElement element) {
				if (excludedMethods.contains(element.getSimpleName().toString()))
					return;

				methodWithAnnotation.value0=false;
				final List<ModelAnnotation> annotationList = new ArrayList<>();

				// optional annotations
				final List<ModelAnnotation> supportAnnotationList = new ArrayList<>();

				AnnotationUtility.forEachAnnotations(element, new AnnotationFoundListener() {

					@Override
					public void onAcceptAnnotation(Element element, String annotationClassName,
							Map<String, String> attributes) {

						if // @formatter:off
						(annotationClassName.equals(BindSqlInsert.class.getCanonicalName())
								|| annotationClassName.equals(BindSqlUpdate.class.getCanonicalName())
								|| annotationClassName.equals(BindSqlDelete.class.getCanonicalName())
								|| annotationClassName.equals(BindSqlSelect.class.getCanonicalName())
								|| annotationClassName.equals(BindContentProviderEntry.class.getCanonicalName()))
						// @formatter:on
						{
							if (!annotationClassName.equals(BindContentProviderEntry.class.getCanonicalName())) {
								methodWithAnnotation.value0=true;	
							}
							
							ModelAnnotation annotation = new ModelAnnotation(annotationClassName, attributes);
							annotationList.add(annotation);
						}
						// we don't insert annotation

					}
				});
										
				annotationList.addAll(supportAnnotationList);
				final SQLiteModelMethod currentMethod = new SQLiteModelMethod(currentDaoDefinition, element,
						annotationList);
				
				AssertKripton.assertTrueOrInvalidMethodSignException(methodWithAnnotation.value0,  currentMethod, "method must be annotated with @%s, @%s, @%s or @%s",
						BindSqlSelect.class.getSimpleName(),
						BindSqlInsert.class.getSimpleName(),
						BindSqlUpdate.class.getSimpleName(),
						BindSqlDelete.class.getSimpleName());
						// annotated", currentDaoDefinition.getName(),
						// element.getSimpleName());

				addWithCheckMethod(currentDaoDefinition, currentMethod);
			}

			private void addWithCheckMethod(SQLiteDaoDefinition currentDaoDefinition, SQLiteModelMethod newMethod) {
				SQLiteModelMethod oldMethod = currentDaoDefinition.findPropertyByName(newMethod.getName());

				// ASSERT: same name and same number
				if (oldMethod != null && oldMethod.getParameters().size() == newMethod.getParameters().size()) {
					boolean sameParameters = true;
					for (int i = 0; i < oldMethod.getParameters().size(); i++) {
						if (!oldMethod.getParameters().get(i).value1.equals(newMethod.getParameters().get(i).value1)) {
							sameParameters = false;
							break;
						}
					}

					AssertKripton.failWithInvalidMethodSignException(sameParameters, newMethod,
							"conflict between generated method and declared method.");
				}

				// add method
				currentDaoDefinition.add(newMethod);

			}

		});
	}
826941
public static ModelWrapper wrap(Object model) {
        if (!(isModel(model.getClass()))) {
            throw new IllegalArgumentException("The given object is no model");
        }
        return new ModelWrapper((OpenEngSBModel) model);
    }
825752
private Set<ModelDescription> loadModelsOfBundle(Bundle bundle) {
        Enumeration<URL> classEntries = bundle.findEntries("/", "*.class", true);
        Set<ModelDescription> models = new HashSet<ModelDescription>();
        if (classEntries == null) {
            LOGGER.debug("Found no classes in the bundle {}", bundle);
            return models;
        }
        while (classEntries.hasMoreElements()) {
            URL classURL = classEntries.nextElement();
            String classname = extractClassName(classURL);
            if (isModelClass(classname, bundle)) {
                models.add(new ModelDescription(classname, bundle.getVersion().toString()));
            }
        }
        return models;
    }
804756
def init_model(engine):
    """"""
    if meta.Session is None:
        sm = orm.sessionmaker(autoflush=True, autocommit=False, bind=engine)

        meta.engine = engine
        meta.Session = orm.scoped_session(sm)
716666
public List<EDBObject> convertModelsToEDBObjects(List<OpenEngSBModel> models, ConnectorInformation info) {
        List<EDBObject> result = new ArrayList<>();
        if (models != null) {
            for (Object model : models) {
                result.addAll(convertModelToEDBObject(model, info));
            }
        }
        return result;
    }
570005
public IndexCommitBuilder insert(Object object) {
        updateModelClassSet(object);
        getInsertList(object.getClass()).add((OpenEngSBModel) object);
        return this;
    }
438570
public static void registerXMLBindingClassForPropGetSetMethod(final Class<?> cls) {
        if (registeredXMLBindingClassList.containsKey(cls)) {
            return;
        }

        synchronized (entityDeclaredPropGetMethodPool) {
            registeredXMLBindingClassList.put(cls, false);

            if (entityDeclaredPropGetMethodPool.containsKey(cls)) {
                entityDeclaredPropGetMethodPool.remove(cls);
                entityDeclaredPropSetMethodPool.remove(cls);

                entityPropFieldPool.remove(cls);
                loadPropGetSetMethodList(cls);
            }
        }
    }