j256 / ormlite-android

ORMLite Android functionality used in conjunction with ormlite-core
http://ormlite.com/
ISC License
1.59k stars 367 forks source link

Refactoring model packages not updating DatabaseTableConfig #64

Open josephmbeveridge opened 8 years ago

josephmbeveridge commented 8 years ago

Hey,

I'm in the process of refactoring our model class package hierarchy and running into issues when upgrading to this new refactored version. It appears that DatabaseTableConfig stores the expected path to a given class, to be used when deserializing from the db. However, it doesn't appear to be updated after upgrades, at least not in my case.

My specific case is moving a class from com.company.services.path.Class to com.company.sdk.services.path.Class

Is there a way to trigger a recreation of this table? Ideally I would like to avoid having to manually modify the table. I haven't been able to find any good sources on how to do this.

kpgalligan commented 8 years ago

Modify the config file or the table itself? The last paragraph is confusing. If you want to know if changing a model class can auto-update the table, no. Since you earlier focus on changing packages, I don't think you mean modifying the actual table, though.

josephmbeveridge commented 8 years ago

It is keeping a reference to where it thinks the class should be located and when I move the class it is not being updated. How can I tell it where to look for my model class once it is moved?

degrigorash commented 7 years ago

@josephmbeveridge Did you resolve this issue? I have exactly the same problem.

josephmbeveridge commented 7 years ago

No I ended up having to abandon my plans to refactor packages

j256 commented 7 years ago

Did you try regenerating the database config file? The config file certainly holds the name of the class in it but if you refactor the class you should just regenerate the config file.

Dosssik commented 7 years ago

@j256 Thanks for advice! How exactly i can regenerate this file? I try to find something like config file through project files, but there's nothing like it

UPDATE------------------------- In our project we use default implementation of ORMLite configuration. So, obviously, there's no such file. Is there's the way to solve this issue? Or ORMLite mean "no package-level refactoring at all"? :-(

josephmbeveridge commented 7 years ago

@j256 In my original post I asked how one would regenerate the file but I never got an answer.

j256 commented 7 years ago

Here's the documentation about how to run and regenerate the database table config file. http://ormlite.com/docs/table-config