
The following is a relevant code
ProjectMapper mapper=MybatisUtils. GetSession (). GetMapper (ProjectMapper. Class);
Project project2=mapper. SelectByPrimaryKey (1);
Public static SqlSession getSession () {
SqlSessionFactory factory=getFactory ();
SqlSession session=factory. OpenSession (true);
Return the session.
}
Public static SqlSessionFactory getFactory () {
Try {
Reader Reader=Resources. GetResourceAsReader (" mybatis - config. XML ");
SqlSessionFactory factory=new the SqlSessionFactoryBuilder is (). The build (reader);
Return the factory.
} the catch (IOException e) {
e.printStackTrace();
return null;
}
}
Is this code takes too long, what reason is this excuse me? What's the solution?
CodePudding user response:



CodePudding user response:
SQL statements? How long will it take to get to look at the first directly in the client sideCodePudding user response: