← Back to Stormify Documentation

getDetails

inline fun <D : Any> getDetails(parent: Any, propertyName: String? = null): List<D>

Retrieves all detail (child) entities related to a parent entity through a foreign key.

When propertyName is null, the child type D is scanned for exactly one field whose type matches the parent's class and that field's column is used. When the child type has multiple foreign keys of the same parent type, pass the Kotlin property name on the child class (not the database column name) to disambiguate. The value must be a single field identifier — a dotted traversal path (e.g. "user.address") is rejected with an error.


inline fun <D : Any> getDetails(parent: Any, referenceField: ReferencePath): List<D>

Type-safe variant of getDetails that accepts an annotation-processor-generated reference path (e.g. Paths.AuditEntry_.createdBy) instead of a string. The compiler guarantees the referenced property exists on the child type, so typos and renames surface at build time rather than on first query.