database - Create a web service, JPA entities and DB tables starting with XSDs -


i'm working on contract-first integration design xsd&wsdl files first provide customers call specific web service hosted on our servers. need save requests in db tables (oracle db @ first, others coming later) in structured manner. need save fields separate columns , multiple occurence nodes should have own tables etc.

i thinking creating ws stubs xsds , tagging them entities jpa, creating db tables using these entities. i'm learning jpa (eclipselink) , wondering if best approach.

so question is: how both create web service, jpa entities , db tables when start request/response xsd?

thanks ideas.

regards, gökhan

using web service generated classes jpa entities might seem idea, in practice going nightmare maintain.

it's better keep jpa layer , webservice layer separated.

jpa layer driven optimal database design (things relations, normalization/denormalization performance reasons, usage of appropriate field types, primary key creation strategy, etc.)

on other hand, web service layer external interface application (or part of application), either given or designed in such way, comfortable api usage point of view , far optimal jpa point of view.

think happen if tell wsdl changed, fields moved 1 class other. if web service generated classes entities have alter db schema, migrate data, etc.

and vice versa. if need change db schema (for performance reasons, instance), need alter application web service interface, doubt web service users happy that.

so, if means more work, keep jpa layer , web service layer separated, can change 1 part without altering one.

in model view controller pattern jpa layers part of model, web service view - should not depend on each other much.


Comments