资源描述:
《java高级工程师面试题ssh》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、Java高级工程师面试题SSHInterviewtopicsforseniorJavaengineersInterviewswiththreeframeworksforStruts,Spring,andHibernateHowdoesHibernateworkandwhy?Howitworks:(1).readandparsetheconfigurationfile(2).Readandparsethemappinginformation,createSessionFactory(3).OpenSession(4)createatransactionTransation(5).persis
2、toperations(6).Committransaction(7).CloseSession(8)Whyuseit?(1).ThecodefortheJDBCaccessdatabaseisencapsulated,greatlysimplifyingthetediouscodeofthedataaccesslayer・(2).hibernateisaJDBCbasedmainstreampersistenceframeworkthatisagoodORMimplementation.HegreatlysimplifiesthecodingoftheDAOlayer(3).hibern
3、ateUSEStheJavareflectionmechanisminsteadofbytecodeenhancementprogramstoachievetransparency.(4).hibernateperformsverywell,Becauseit'salightweightframework・Theflexibilityofmappingisexcellent・Itsupportsavarietyofrelationaldatabasesfromone-to~onetomany-to-manycomplexrelationships・HowdoesHibernatedelay
4、loading?(1).hibernate2delayedloadingimplementation:a)entityobjectb)collections(2).hibernate3providesthelazyloadingfeatureoftheattributewhenHibernateisqueryingthedata,thedataisnotinthememory,Whentheprogramactuallyoperatesonthedata,theobjectisonlyinmemory,itisdelayedloading,hesavestheserversmemoryov
5、erhead,Thisimprovestheperformanceoftheserver.HowdoyouimplementtherelationshipbetweenclassesinHibernate?(forexample,one-to-many,many-to-manyrelationships)Therelationshipbetweenclassesandclassesmainlyreflectstherelationshipbetweenthetableandthetable,andthecityoperatesontheobject,Inourprogram,allthet
6、ablesandclassesaremappedtogether,Theyareintheconfigurationfileofmany-one,one-to-many,many一many4.Struts2process:(1)thedientbrowsermakesHTTPrequests・(2)therequestisreceivedbytheActionServlet,accordingtotheweb.xmlconfiguration.(3),accordingtothestruts-config.xmlconfiguration,theActionServletfirstpopu
7、latestheparametersintherequesttoActionForm,TheActionServletthensendstherequesttotheActionforprocessing・(1)verifythatthevalidatemethodoftheActionFormisinvoked,andthevalidationfailstotheinput,andthesuccesscontinues