我正在使用 SORM 将一个类持久化到 MySQL。这个类包含我在类上需要的一两个字段,但不会被持久化到数据库中。有谁知道如何从表定义中排除这些?
问题是 SORM 不支持该字段的类型。没问题,因为它是一个演员 ref,不应该被持久化,但似乎没有一种简单的方法可以告诉 SORM 忽略它。
谢谢。
There is no way to ignore fields in SORM.
In fact it is a very bad idea from a design perspective to mix a business logic (which an actor ref definitely is) into a model. A model should be just data, nothing else. Even if SORM didn't require that, I would still recommend you to extract the actor-related logic into another object.