Db4o Client/Server Mode without persistent class : Unique Constraint / Indexes

谁都会走 提交于 2019-12-12 00:57:57

问题


It's not clear for me from the documentation if a db4o server in java without persistent class can handle unicity constraint, I see nothing saying no, but the way to configure it on the server we need the class on the classpath. (and I don't want that in that case).

Same question for indexes ?

Thanks in advance.


回答1:


My recommendation: Don't do a db4o server without the persistent classes available. That leads to countless issues.

Anyway, you should be able to just specify the full qualified class-name as a string and it should work.

    config.objectClass("your.package.YourClass").objectField("id").indexed(true);
    config.add(new UniqueFieldValueConstraint("your.package.YourClass", "id"));


来源:https://stackoverflow.com/questions/8187130/db4o-client-server-mode-without-persistent-class-unique-constraint-indexes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!