An array column stores multiple values inside one database table column. In reactive persistence, it can represent related entity IDs when direct relationships are unavailable. section 13.1.1
Storing taco ingredients
A Taco entity keeps ingredientIds as a Set<Long>. Its addIngredient method adds an Ingredient ID, while the Taco table stores those values in an ingredient_ids array column. H2 and PostgreSQL support array columns, although array entries may not enforce foreign-key integrity. section 13.1.1
Choose an array column with these trade-offs:
- Use it to persist collections of related IDs when the database supports array types. section 13.1.1
- Recognize that many databases lack array support, and supported arrays may not provide referential integrity. section 13.1.1
