Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - JPA 2, JSF, setting id of OneToOne mapped entity problem -


we havent used jpa or other orm tools in our web application, have been on updating whole stuff java ee 6,
problem jpa ,i have been looking answer,and learn how people solve kinda issue, have 2 entites,

  @entity person { @id private long id;  @joincolumn(name="city_id") @onetoone(fetch=fetchtype.lazy) private city city; .... }   

and second entity

  @entity city { @id private long id; private string name; ..... } 

i querying person entity , show 1 on jsf page

i have 2 input fields person.city show on jsf page inputhidden id , inputtext name people selecting cities popup set hidden component city id, new selected new value, , same name, everthing goes fine till now, when merge person entity, tries merge city also, id defined on table, constraint error cirty id.

what doing kinda problem?

i thought valuechange action inputhidden,but @ jsf life cycle happens before update model if replace person.city entity new 1 in action , updated again (actually same values done twice) ,so best workaround situation?

thanx

you trying save new person , assign existing city? if so, , if using persistantmanager.persist(person) tries create new city, fails. can tell relationship person city options follow, see cascading (merge in case guess).


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -