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.
有没有办法让数据库以自动方式创建 ID 属性?
我想生成如下所示的东西:
Entity entity = schema.addEntity("MyEntity"); entity.addIdProperty().autoIncrement().primaryKey();
这可能吗?
是的,这看起来很好。根据您的需要 entity.addIdProperty() 或 entity.addIdProperty().autoIncrement() 应该没问题。addIdProperty 已经调用了primaryKey()。