Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Good example of EJB interface for CRUD operations Date: Mon, 27 Apr 2015 21:19:29 +0200 Lines: 28 Message-ID: References: <99e89a59-7115-4862-8679-42d670cb89dc@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net aatGzkt3ajhUnxm2goQ7owhd8zfSrLLM+s2LsNfjaqFMJi3QQ= Cancel-Lock: sha1:fY0inry+v33DqGaRH7DDGq++8V4= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: <99e89a59-7115-4862-8679-42d670cb89dc@googlegroups.com> Xref: csiph.com comp.lang.java.programmer:31617 On 27.04.2015 19:00, pavelkastornii@gmail.com wrote: > Can anyone provide a good example of EJB interface for not trivial > CRUD operations, assuming the following: > > There are two or more tables (for example persons,personContacts) > with which this EJB work. There are dynamic operations (like > select(List columnAliases,List columnValues)) and > static operations (like select(int id)). What do you mean by "dynamic operations"? Are you talking about queries whose conditions need to be compiled at runtime? I also find the interface odd: apparently you match column names and values by index in two lists. Why are you not using a Map for that? > There full > (updatePerson(Person person,int id)) and particial operation > (updatePersonName(String name,int id)). Wouldn't you just set property "name" of Pojo Person and commit? Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/