oop - Problems in reusing a single POJO class for different databases -


i using pojo (plain old java object) classes mapping relational database , using apache solr index database.

i don't know whether can re-use pojo classes apache solr or not.

since mapping classes specific , designed foreign key relationship in mind, difficult use classes solr (a single schema search server), creating new pojo classes apache solr difficult.

so want know better design approach reusing.

also know pitfalls of reusing same pojo class.

solr different relational database...basically big table (with several differences multivalued columns).

now, see problem step behind concrete implementation (pojo)...

first, have de-normalize table(s)...that's real hard thing need when working solr. mean passing er solr schema. once did that, can use solrj map entity pojo, last part of story.

still denormalization: doesn't make sense raw translation of set of pojo mapped on top of relational database. relational databases general-purpose: design approach data-centric. mean, first decide how store data , after sql clients able need.

solr works in different way: in order determine moreless schema should know search requirements (i.e. queries). schema not general-purpose (like database) tiered on top of search requirements. that's reason why index atrtribute or not, decide kind of analysis needs particular field, multivalued, monovalued, stemming, etc etc etc

so basically, it's denormalization , query requirements.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -