<commit_before>package org.minimalj.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.minimalj.model.properties.Properties;
import org.minimalj.model.properties.PropertyInterface;
import org.minimalj.util.FieldUtils;
import org.minimalj.util.IdUtils;

public interface Model {

	/**
	 * Defines the (root) entities. These are the classes the are used for a
	 * repository. View classes should not be listed here.
	 * 
	 * @return all the classes used for this Model. These classes will be checked
	 *         for compliance by the ModelTest .
	 */
	public Class<?>[] getEntityClasses();

	/**
	 * Find all main entities (not the ones without id)
	 * 
	 * @param baseClasses the classes from the model
	 * @return the main entities 
	 */
	public static List<Class<?>> getEntityClassesRecursive(Class<?>[] baseClasses) {
		return getClassesRecursive(baseClasses, false, true);
	}
	
	public static List<Class<?>> getClassesRecursive(Class<?>[] baseClasses, boolean depthFirst, boolean onlyWithId) {
		List<Class<?>> classes = new ArrayList<>();
		for (Class<?> clazz : baseClasses) {
			getClassesRecursive(classes, clazz, depthFirst, onlyWithId);
		}
		return classes;
	}

	private static void getClassesRecursive(List<Class<?>> classes, Class<?> clazz, boolean depthFirst, boolean onlyWithId) {
		if (!classes.contains(clazz)) {
			classes.add(clazz);
			for (PropertyInterface property : Properties.getProperties(clazz).values()) {
				Class<?> propertyClass = property.getClazz();
				if (propertyClass == Selection.class) {
					continue;
				}<commit_msg>getEntityClassesRecursive should exclude Views<commit_after>package org.minimalj.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.minimalj.model.properties.Properties;
import org.minimalj.model.properties.PropertyInterface;
import org.minimalj.util.FieldUtils;
import org.minimalj.util.IdUtils;

public interface Model {

	/**
	 * Defines the (root) entities. These are the classes the are used for a
	 * repository. View classes should not be listed here.
	 * 
	 * @return all the classes used for this Model. These classes will be checked
	 *         for compliance by the ModelTest .
	 */
	public Class<?>[] getEntityClasses();

	/**
	 * Find all main entities (not the ones without id)
	 * 
	 * @param baseClasses the classes from the model
	 * @return the main entities 
	 */
	public static List<Class<?>> getEntityClassesRecursive(Class<?>[] baseClasses) {
		return getClassesRecursive(baseClasses, false, true);
	}
	
	public static List<Class<?>> getClassesRecursive(Class<?>[] baseClasses, boolean depthFirst, boolean onlyWithId) {
		List<Class<?>> classes = new ArrayList<>();
		for (Class<?> clazz : baseClasses) {
			getClassesRecursive(classes, clazz, depthFirst, onlyWithId);
		}
		return classes;
	}

	private static void getClassesRecursive(List<Class<?>> classes, Class<?> clazz, boolean depthFirst, boolean onlyWithId) {
		if (!classes.contains(clazz)) {
			classes.add(clazz);
			for (PropertyInterface property : Properties.getProperties(clazz).values()) {
				Class<?> propertyClass = property.getClazz();
				if (View.class.isAssignableFrom(propertyClass) || propertyClass == Selection.class) {
					continue;
				}
{'fraction_non_alphanumeric': 0.11411229135053111, 'fraction_numerical': 0.0, 'mean_word_length': 4.5675675675675675, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4616327', 'n_tokens_mistral': 1013, 'n_tokens_neox': 924, 'n_words': 280}