class AbstractEntityAndManagerTranslator<T extends ClassOrInterface<T>>
    extends AbstractJavaClassTranslator<Table, T> {

    protected AbstractEntityAndManagerTranslator(
        final Injector injector,
        final Table table,
        final Function<String, T> modelConstructor
    ) {
        super(injector, table, modelConstructor);
    }

    protected Type typeOfPK() {<FILL_FUNCTION_BODY>}
    
    private Stream<Column> columnsFromPks() {
        return primaryKeyColumns().map(pk -> {
            try {
                return pk.findColumnOrThrow();
            } catch (final NoSuchElementException ex) {
                throw new SpeedmentTranslatorException(
                    "Could not find any column belonging to primary key '" + pk.getId() + "'.", ex
                );
            }
        });
    }
}

        final long pks = primaryKeyColumns().count();

        if (pks == 0) {
            return DefaultType.list(DefaultType.WILDCARD);
        }

        final Column firstColumn = columnsFromPks()
                .findFirst().orElseThrow(() -> new SpeedmentTranslatorException(
                    "Table '" + table().get().getId() + 
                    "' did not contain any primary key columns."
                ));
        
        Type firstType = typeMappers().get(firstColumn).getJavaType(firstColumn);
        if (DefaultType.isPrimitive(firstType)) {
            firstType = DefaultType.wrapperFor(firstType);
        }

        if (pks == 1) {
            return firstType;
        } else if (columnsFromPks()
            .map(c -> typeMappers().get(c).getJavaType(c))
            .allMatch(firstType::equals)) {
            
            return DefaultType.list(firstType);
        } else {
            return DefaultType.list(DefaultType.WILDCARD);
        }
    
<methods>public com.speedment.common.codegen.model.Constructor copyConstructor(java.lang.reflect.Type, com.speedment.generator.translator.AbstractJavaClassTranslator.CopyConstructorMode) ,public com.speedment.common.codegen.model.Constructor emptyConstructor() ,public com.speedment.common.codegen.model.Field fieldFor(com.speedment.runtime.config.Column) ,public com.speedment.common.codegen.model.File get() ,public com.speedment.common.codegen.Generator getCodeGenerator() ,public final com.speedment.runtime.config.Table getDocument() ,public final TranslatorSupport<com.speedment.runtime.config.Table> getSupport() ,public boolean isInGeneratedPackage() ,public Stream<BiConsumer<com.speedment.common.codegen.model.File,Builder<T>>> listeners() ,public void onMake(BiConsumer<com.speedment.common.codegen.model.File,Builder<T>>) <variables>protected static final java.lang.String FINDER_METHOD_PREFIX,protected static final java.lang.String GETTER_METHOD_PREFIX,private static final java.lang.String JAVADOC_MESSAGE,protected static final java.lang.String SETTER_METHOD_PREFIX,private final non-sealed com.speedment.runtime.config.Table document,private final non-sealed com.speedment.common.codegen.Generator generator,private final non-sealed com.speedment.runtime.core.component.InfoComponent infoComponent,private final non-sealed com.speedment.common.injector.Injector injector,private final non-sealed List<BiConsumer<com.speedment.common.codegen.model.File,Builder<T>>> listeners,private final non-sealed Function<java.lang.String,T> mainModelConstructor,private final non-sealed com.speedment.runtime.typemapper.TypeMapperComponent typeMappers