0

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.

taharqa
  • 1,112
  • 1
  • 13
  • 19

1 Answers1

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"));
Gamlor
  • 12,978
  • 7
  • 43
  • 70
  • thanks for your answer Gamior. What kind of issues, can you share ? I agree with you that its better to use persistent classes available. On db4o site they seems to say "possible but you cannot use NQ" so what is the issue you mention ? regards – taharqa Nov 19 '11 at 19:28