android - GreenDAO generated entities / name package convention -


I am currently evaluating for my application. I am facing the following problem.

There are several modules in my app (different in packages, like " com.example.app.results ", " com example.app.synchronization "). Some of them have no dependency, some of them depend on other modules (such as synchronization dependence result , while results have any Dependency is not)

What I would like to model is the following:

The module is the unit of result code (attributes: name, value).

The module synchronization has the unit MyResult synchronization (attributes: MyResult (reference), date).

  Final schema schema = new schema (1, "com.example.app"); Final unit myresult = schema.addEntity ("results.MyResult"); Final asset myresultId = myresult.addIdProperty (). GetProperty (); Myresult.addStringProperty ("name"); Myresult.addStringProperty ("Price"); Final unit myResultSynchronization = schema.addEntity ("Synchronization. MyResult Synchronization"); MyResultSynchronization.addIdProperty (); MyResultSynchronization.addDateProperty ("date"); MyResultSynchronization.addToOne (myresult, myresultId);  

but - $ entityPackage. $ Name I did not expect this (nor the $ package \ $ name ; -)).

My question is is do I have all the institutions of my app in the same package? Am I trying to make multiple schemas possible - but again, it is possible to use the relation between two (or more) schemas? What is the "right" way to do this? (Anyone?)

In fact, all institutions should be in the same package.

Normally you use a structure like

  com.example.myapp.data   

where You put everything to manage your database, especially your unit class. Inside you can make Grindo a Dow package, where it will keep all the things you need to reach your data (base).

Of course you can apply your nanaming schema by making several sxhemas in Granendo. But the schema will be free: they will not use the same database and you will not be able to link them together with the toOne () example.

If you still want to use your naming schema, you can generate everything for an intermediate package and take it manually to your desired package. But you have to repeat it to your database schema on every change, which can be more than ever before.


Comments