0

I'm new in Db4o

As far as I checked, when I do a refactoring of a class name or path (packages), db4o doesnt recognizes the class anymore and creates a new 'category'.

I want to make an API, so that any class refactoring in my app won't affect the database. I've created the following function ...

public void saveClassAs(Class objClass, String nameInDB){
   configuration.common().objectClass(objClass).rename(nameInDB);
}

and have it called for each of my classes. Since the nameInDB will be constant for each class, no matter where the class is located or its name.

The problem is that Im not sure if will this work and I don't know if this is a good idea in matters of speed ... I didn't find any details on db4o documentation about how the renaming API works. Any help?

ApollonDigital
  • 913
  • 3
  • 15
  • 24

1 Answers1

0

If you want to use constant class names (irrespective to the real classes names) my best bet is to use aliases.

Regarding renaming configuration you can find details here.

Vagaus
  • 4,174
  • 20
  • 31
  • I had already checked these links. They dont describe the differences between these 2 and how each one works. Notice that in chapter 'refactoring' describes only the renaming API and it doesn't have any link to alias configuration. So? – ApollonDigital Nov 06 '12 at 01:23