EntityInfo.ktEntityType to provide introspective access to entity metadata: property discovery, annotation inspection, column length lookups, and persistence checks. Used by the import subsystem and persistence layer to dynamically map between imported data and JPA entity properties.EntityInfo wraps a JPA EntityType<*> and eagerly populates a list of EntityPropertyInfo objects for each JPA attribute that has a javaMember. It serves as a bridge between JPA's metamodel and ProjectForge's runtime reflection needs.
| Parameter | Type | Purpose |
|---|---|---|
entityClass | Class<*> | The Java/Kotlin class of the entity |
name | String | Entity name (typically the JPA entity name) |
entityType | EntityType<*> | JPA metamodel type providing attribute access |
tableName | String? | Optional database table name |
| Method | Return | Description |
|---|---|---|
getIdProperty() | String? | Returns the name of the ID property (first property marked as ID) |
isPersistedProperty(property: KCallable) | Boolean | Checks if a Kotlin callable corresponds to a persisted JPA attribute |
isPersistedProperty(propertyName: String) | Boolean | Checks by property name |
getPropertyInfo(propertyName) | EntityPropertyInfo? | Retrieves full property metadata |
getPropertiesWithAnnotation(annotationClass) | List<EntityPropertyInfo> | Finds all properties bearing a specific annotation |
getColumnAnnotation(propertyName) | Column? | Retrieves the JPA @Column annotation |
getColumnLength(propertyName) | Int? | Extracts column length from @Column(length=...); logs warning on failures for DO entities |
The class supports both string-based property lookups and Kotlin reflection (KCallable, KMutableProperty1). The isPersistedProperty overloads allow callers to check whether a Kotlin property corresponds to a JPA column, which is essential for the import subsystem's automatic property mapping.
getColumnLength() uses an internal columnWithoutLength set to avoid repeated log messages when a property has no @Column annotation. Properties ending in "DO" are logged at ERROR level, others at INFO level — treating DO entities as expected to have full JPA annotations.
initAbstractManagedType typically)868d6abb7 2025 -> 2026 63081666f Source file headers: 2024-> 2025. bbc198d03 Migration stuff in progress... (all tests of all packages: OK). e801b0336 Migration stuff in progress... efee0def3 Migration stuff in progress... eb4e16a33 Migration stuff in progress... ca4cb86c8 Migration stuff in progress... e4545c8e1 Migration stuff in progress... 7f86d3730 Migration stuff in progress... d476c7b0d Migration stuff in progress... 067a4cbb1 Migration stuff in progress... 67ce75fe9 Migration stuff in progress...