Hibernate's core configuration file

Source: Internet
Author: User

Core configuration Files
<!--Sessionfactory, equivalent to learning the connection pool configuration before -    <session-factory>        <!--1 Basic 4 Items -        < Propertyname= "Hibernate.connection.driver_class">Com.mysql.jdbc.Driver</ Property>        < Propertyname= "Hibernate.connection.url">jdbc:mysql:///h_day01_db</ Property>        < Propertyname= "Hibernate.connection.username">Root</ Property>        < Propertyname= "Hibernate.connection.password">1234</ Property>            <!--2 binding with local thread -        < Propertyname= "Hibernate.current_session_context_class">Thread</ Property>          <!--3 dialect: for different databases, different versions, generate SQL statements (DQL query statements) to provide basis * MySQL string varchar * Orcale string VARCHAR2 
     -         < Propertyname= "Hibernate.dialect">Org.hibernate.dialect.MySQL5Dialect</ Property>                <!--4 SQL statements -        <!--Displaying SQL statements -        < Propertyname= "Hibernate.show_sql">True</ Property>        < Propertyname= "Hibernate.format_sql">True</ Property>            <!--5 Automatically create tables (learn), use in learning, develop unused.                * The DBA first creates the table, and then the PO class * is evaluated according to the table: Update: "" If the table does not exist, the table will be created. If the table already exists, update the table (add) through the HBM mapping file.            (The mapping file must be a database counterpart) the columns in the table can be many and are not responsible for deletion. Create: If the table exists, delete it before creating it. The previously created table is not deleted at the end of the program. "Create-drop: Almost the same as create. If Factory.close () executes, the created table will be deleted while the JVM shuts down. (test) Validate: Verifies that the HBM mapping file and the column of the table correspond, if the corresponding normal execution, if not the exception should be thrown. (test) -        < Propertyname= "Hibernate.hbm2ddl.auto">Create</ Property>                <!--6 Java Web 6.0 holds a problem * beanfactory NULL pointer exception exception hint: Org.hibernate.HibernateException:Unable to Get the default Bean Validation Factory * Solution: Cancel Bean checksum -        < Propertyname= "Javax.persistence.validation.mode">None</ Property>            <!--Add Map File <mapping > Add mapping File resource set XML configuration file (AddResource (XML)) class The Configuration Class (AddClass (User.class)) is configured with a fully qualified class name -        <MappingResource= "Com/itheima/a_hello/user.hbm.xml"/>    </session-factory>

Hibernate's core configuration file

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.