Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想为域类的一个字段存储一个描述 20 个值的枚举。放在哪里enum.groovy以便我可以在许多域类中使用它?
enum.groovy
我通常将它们放在 src/groovy 中,但我也看到它们本身作为瞬态属性放入域中。我认为任何一种方式都可以接受。
通过 Grails Convention over Configuration,任何支持资源都应该放在src/groovy或下src/java。
Convention over Configuration
src/groovy
src/java