1. Integrate spring + hibernate and let spring take over the hibernate session factory with a piece of code[Java]
View the source code: org. springframework. orm. hibernate3.LocalSessionFactoryBean:[Java]Public class LocalSessionFactoryBean extends
Lazy loading means that the program delays accessing the database. This ensures that sometimes it is unnecessary to access the database because it is time-consuming to access the database once.I. load Method lazy loadingFirst look at the following
Reflection is one of the characteristics of the Java programming language. It allows running Java programs to check themselves, or "self-Review", and can directly operate on internal properties of the program. For example, you can use it to obtain
Object-oriented features: inheritance, encapsulation, and PolymorphismInheritance definition: defines a new class named inheritance based on a class. The original class is called parent class, and the new class is called subclass.Inheritance
Each time a member variable modified by Volatile is accessed by a thread, the value of the member variable is forcibly re-read from the main memory. In addition, when the member variables change, the thread is forced to write the change value back
Fixed Thread PoolPublic static ExecutorService newFixdThreadPool (int size );This method generates a thread pool with a fixed size. If a thread is aborted abnormally, a new thread is generated to replace it. The parameter size is used to indicate
After three versions of Spring MVC, the functions have been improved and improved a lot. Especially since 2.5, the Annotation parameter binding has greatly facilitated development, and 3.0 has further improved it. For some special foreground
Overall process1: Read the cfg. xml file through configuration2: Get the SessionFactory3: Use the SessionFactory factory to create a Session instance4: open a transaction through Session5. Operate the database through the session api6: transaction
The Application of Hibernate3.jar is deployed on weblogic10.3, and an exception org. hibernate. queryException: ClassNotFoundException: org. hibernate. hql. ast. hqlToken [from hbm. pojo. area where code =: code]
Solution:
1. Add a property
Idea: because the content of each java source file consists of java statements, blank lines, and annotations (excluding annotations), when calculating the content of each of the three parts of a file, you only need to write three regular expressions
OutputStream is stored as String, and OutputStream is the output stream used to output the file content. It does not provide input operations (that is, you cannot directly store OutputStream as String ). The following are two methods I have found:
/
In the past few days, we have been doing time-based user authentication queries. Because in MySQL, the time field uses the bigint type, all of which are in milliseconds. To convert the millisecond value from the database to the date format, you need
Runtime exceptions:A runtime exception is thrown if no declaration is required during method definition;You do not need to capture this runtime exception when calling this method;Runtime exception is derived from the java. lang. runtimeexception or
Static indicates the meaning of "global" or "static". It is used to modify member variables and member methods. It can also form static code blocks, but Java does not have the concept of global variables.
The static modified member variables and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.