master
1443155017@qq.com 5 years ago
parent 27edceabeb
commit 04fdb353a6

@ -0,0 +1,13 @@
<component name="ArtifactManager">
<artifact type="exploded-war" name="HibernateDamo:war exploded">
<output-path>$PROJECT_DIR$/out/artifacts/HibernateDamo_war_exploded</output-path>
<root id="root">
<element id="javaee-facet-resources" facet="HibernateDamo/web/Web" />
<element id="directory" name="WEB-INF">
<element id="directory" name="classes">
<element id="module-output" name="HibernateDamo" />
</element>
</element>
</root>
</artifact>
</component>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="8" />
</component>
</project>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="dataSourceStorageLocal">
<data-source name="xianshu@localhost" uuid="f04c8927-a966-444e-85ca-60ef5b013a3e">
<database-info product="MySQL" version="8.0.16" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-java-8.0.15 (Revision: 79a4336f140499bd22dd07f02b708e163844e3d5)" dbms="MYSQL" exact-version="8.0.16" exact-driver-version="8.0">
<extra-name-characters>#@</extra-name-characters>
<identifier-quote-string>`</identifier-quote-string>
</database-info>
<case-sensitivity plain-identifiers="lower" quoted-identifiers="lower" />
<secret-storage>master_key</secret-storage>
<user-name>root</user-name>
<schema-mapping>
<introspection-scope>
<node kind="schema" qname="@" />
</introspection-scope>
</schema-mapping>
</data-source>
</component>
</project>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="xianshu@localhost" uuid="f04c8927-a966-444e-85ca-60ef5b013a3e">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://localhost:3306/xianshu</jdbc-url>
<driver-properties>
<property name="autoReconnect" value="true" />
<property name="zeroDateTimeBehavior" value="CONVERT_TO_NULL" />
<property name="tinyInt1isBit" value="false" />
<property name="characterEncoding" value="utf8" />
<property name="characterSetResults" value="utf8" />
<property name="yearIsDateType" value="false" />
</driver-properties>
</data-source>
</component>
</project>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,2 @@
#n:information_schema
!<md> [null, 0, null, null, -2147483648, -2147483648]

@ -0,0 +1,27 @@
<component name="libraryTable">
<library name="Hibernate 5.4.9-5.4.9" type="hibernate">
<properties version="5.4.9" />
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/classmate-1.5.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/hibernate-commons-annotations-5.1.0.Final.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/istack-commons-runtime-3.0.7.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/FastInfoset-1.2.15.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/javax.activation-api-1.2.0.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/antlr-2.7.7.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jandex-2.1.1.Final.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/dom4j-2.1.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/javassist-3.24.0-GA.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/javax.persistence-api-2.2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jaxb-api-2.3.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jboss-transaction-api_1.2_spec-1.1.1.Final.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/stax-ex-1.8.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jboss-logging-3.3.2.Final.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/txw2-2.3.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/jaxb-runtime-2.3.1.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/byte-buddy-1.10.2.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/hibernate-core-5.4.9.Final.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

@ -0,0 +1,15 @@
<component name="libraryTable">
<library name="Java EE 6-Java EE 6">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/javax.ejb.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/javax.jms.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/javax.resource.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/javax.annotation.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/javax.servlet.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/javax.servlet.jsp.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/javax.servlet.jsp.jstl.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="lib">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" />
</library>
</component>

@ -0,0 +1,10 @@
<component name="libraryTable">
<library name="lib (2)">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/lib" recursive="false" />
</library>
</component>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/HibernateDamo.iml" filepath="$PROJECT_DIR$/HibernateDamo.iml" />
</modules>
</component>
</project>

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/pjr4z27u5" vcs="Git" />
</component>
</project>

@ -0,0 +1,260 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ArtifactsWorkspaceSettings">
<artifacts-to-build>
<artifact name="HibernateDamo:war exploded" />
</artifacts-to-build>
</component>
<component name="ChangeListManager">
<list default="true" id="112422a6-b7f7-4ea7-a2cb-16035012fff6" name="Default Changelist" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DatabaseView">
<option name="SHOW_INTERMEDIATE" value="true" />
<option name="GROUP_DATA_SOURCES" value="true" />
<option name="GROUP_SCHEMA" value="true" />
<option name="GROUP_CONTENTS" value="false" />
<option name="SORT_POSITIONED" value="false" />
<option name="SHOW_EMPTY_GROUPS" value="false" />
<option name="AUTO_SCROLL_FROM_SOURCE" value="false" />
<option name="HIDDEN_KINDS">
<set />
</option>
<expand>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="xianshu@localhost" type="feb32156:DbDataSourceImpl" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="xianshu@localhost" type="feb32156:DbDataSourceImpl" />
<item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="xianshu@localhost" type="feb32156:DbDataSourceImpl" />
<item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="xianshu: schema" type="76f4a085:MysqlImplModel$Schema" />
</path>
</expand>
<select />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="hibernate-configuration-5.2" />
<option value="hibernate-main-5.2" />
<option value="Class" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/pjr4z27u5" />
</component>
<component name="ProjectId" id="1VpNQTsimTghYCcxEtvoKr0YKl0" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="PropertiesComponent">
<property name="DatabaseDriversLRU" value="oracle&#10;mysql" />
<property name="Downloaded.Files.Path.Enabled" value="false" />
<property name="JPA.DatabaseSchemaImportDialog" value="f04c8927-a966-444e-85ca-60ef5b013a3e" />
<property name="Repository.Attach.Annotations" value="false" />
<property name="Repository.Attach.JavaDocs" value="false" />
<property name="Repository.Attach.Sources" value="false" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/lib" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="reference.projectsettings.compiler.javacompiler" />
</component>
<component name="RecentsManager">
<key name="ImportMappingsDialog.RecentPackages">
<recent name="table" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="C:\Users\TANGNAN\IdeaProjects\HibernateDamo\lib" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager" selected="Tomcat Server.Unnamed">
<configuration name="AddTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="HibernateDamo" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="test.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="test" />
<option name="MAIN_CLASS_NAME" value="test.AddTest" />
<option name="TEST_OBJECT" value="class" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="AddTest.test" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="HibernateDamo" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="test.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="test" />
<option name="MAIN_CLASS_NAME" value="test.AddTest" />
<option name="METHOD_NAME" value="test" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="Unnamed" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat 7.0.93" ALTERNATIVE_JRE_ENABLED="false" nameIsGenerated="true">
<option name="OPEN_IN_BROWSER_URL" value="http://localhost:8080/HibernateDamo/" />
<option name="UPDATING_POLICY" value="restart-server" />
<deployment>
<artifact name="HibernateDamo:war exploded">
<settings>
<option name="CONTEXT_PATH" value="/HibernateDamo" />
</settings>
</artifact>
</deployment>
<server-settings>
<option name="BASE_DIRECTORY_NAME" value="Unnamed_HibernateDamo" />
</server-settings>
<predefined_log_file enabled="true" id="Tomcat" />
<predefined_log_file enabled="true" id="Tomcat Catalina" />
<predefined_log_file id="Tomcat Manager" />
<predefined_log_file id="Tomcat Host Manager" />
<predefined_log_file id="Tomcat Localhost Access" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="29097" />
</RunnerSettings>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Cover">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Debug">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
<option name="USE_ENV_VARIABLES" value="true" />
<STARTUP>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</STARTUP>
<SHUTDOWN>
<option name="USE_DEFAULT" value="true" />
<option name="SCRIPT" value="" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
</SHUTDOWN>
</ConfigurationWrapper>
<method v="2">
<option name="Make" enabled="true" />
<option name="BuildArtifacts" enabled="true">
<artifact name="HibernateDamo:war exploded" />
</option>
</method>
</configuration>
<list>
<item itemvalue="JUnit.AddTest" />
<item itemvalue="JUnit.AddTest.test" />
<item itemvalue="Tomcat Server.Unnamed" />
</list>
<recent_temporary>
<list>
<item itemvalue="JUnit.AddTest" />
<item itemvalue="JUnit.AddTest.test" />
</list>
</recent_temporary>
</component>
<component name="ServiceViewManager">
<option name="allServicesViewState">
<serviceView>
<treeState>
<expand>
<path>
<item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
<item name="com.intellij.execution.services.ServiceModel$ServiceGroupNode@1003e9a1" type="7427dc5b:ServiceModel$ServiceGroupNode" />
</path>
<path>
<item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
<item name="com.intellij.execution.services.ServiceModel$ServiceGroupNode@1003e9a1" type="7427dc5b:ServiceModel$ServiceGroupNode" />
<item name="com.intellij.execution.services.ServiceModel$ServiceNode@345cc67f" type="9fbbdea:ServiceModel$ServiceNode" />
</path>
</expand>
<select />
</treeState>
</serviceView>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="112422a6-b7f7-4ea7-a2cb-16035012fff6" name="Default Changelist" comment="" />
<created>1577946059823</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1577946059823</updated>
<workItem from="1577946063922" duration="18378000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
</project>

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="hibernate" name="Hibernate">
<configuration>
<datasource-map>
<unit-entry name="hibernate.cfg.xml" value="f04c8927-a966-444e-85ca-60ef5b013a3e" />
</datasource-map>
<naming-strategy-map />
<deploymentDescriptor name="hibernate.cfg.xml" url="file://$MODULE_DIR$/src/hibernate.cfg.xml" />
</configuration>
</facet>
<facet type="web" name="Web">
<configuration>
<descriptors>
<deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/web/WEB-INF/web.xml" />
</descriptors>
<webroots>
<root url="file://$MODULE_DIR$/web" relative="/" />
</webroots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Hibernate 5.4.9-5.4.9" level="project" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="module-library">
<library name="JUnit4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="library" name="lib (2)" level="project" />
<orderEntry type="library" name="Java EE 6-Java EE 6" level="project" />
</component>
</module>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,27 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:mysql://localhost:3306/xianshu</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.username">root</property>
<property name="connection.password">123456</property>
<mapping resource="table/BookEntity.hbm.xml"/>
<mapping class="table.BookEntity"/>
<mapping resource="table/OrderEntity.hbm.xml"/>
<mapping class="table.OrderEntity"/>
<mapping resource="table/ShopcartEntity.hbm.xml"/>
<mapping class="table.ShopcartEntity"/>
<mapping resource="table/UserEntity.hbm.xml"/>
<mapping class="table.UserEntity"/>
<!-- <property name="connection.username"/> -->
<!-- <property name="connection.password"/> -->
<!-- DB schema will be updated if needed -->
<!-- <property name="hibernate.hbm2ddl.auto">update</property> -->
</session-factory>
</hibernate-configuration>

@ -0,0 +1,15 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="table.BookEntity" table="book" schema="xianshu">
<id name="bookid" column="bookid"/>
<property name="bookname" column="bookname"/>
<property name="price" column="price"/>
<property name="category" column="category"/>
<property name="imageurl" column="imageurl"/>
<property name="sellerId" column="sellerID"/>
</class>
</hibernate-mapping>

@ -0,0 +1,13 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="table.OrderEntity" table="order" schema="xianshu">
<id name="orderId" column="orderId"/>
<property name="buyerId" column="BuyerID"/>
<property name="sellerId" column="sellerID"/>
<property name="bookId" column="bookID"/>
</class>
</hibernate-mapping>

@ -0,0 +1,12 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="table.ShopcartEntity" table="shopcart" schema="xianshu">
<id name="cartId" column="cartID"/>
<property name="userId" column="userID"/>
<property name="bookid" column="bookid"/>
</class>
</hibernate-mapping>

@ -0,0 +1,14 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="table.UserEntity" table="user" schema="xianshu">
<id name="userId" column="userID"/>
<property name="userName" column="userName"/>
<property name="password" column="password"/>
<property name="school" column="school"/>
<property name="sex" column="sex"/>
</class>
</hibernate-mapping>

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0">
<display-name></display-name>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>UploadServlet</servlet-name>
<servlet-class>test.UploadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>UploadServlet</servlet-name>
<url-pattern>/Upload.action</url-pattern>
</servlet-mapping>
</web-app>

@ -0,0 +1,16 @@
<%--
Created by IntelliJ IDEA.
User: TANGNAN
Date: 2020/1/2
Time: 14:21
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>$Title$</title>
</head>
<body>
$END$
</body>
</html>

@ -0,0 +1,27 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:mysql://localhost:3306/xianshu</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.username">root</property>
<property name="connection.password">123456</property>
<mapping resource="table/BookEntity.hbm.xml"/>
<mapping class="table.BookEntity"/>
<mapping resource="table/OrderEntity.hbm.xml"/>
<mapping class="table.OrderEntity"/>
<mapping resource="table/ShopcartEntity.hbm.xml"/>
<mapping class="table.ShopcartEntity"/>
<mapping resource="table/UserEntity.hbm.xml"/>
<mapping class="table.UserEntity"/>
<!-- <property name="connection.username"/> -->
<!-- <property name="connection.password"/> -->
<!-- DB schema will be updated if needed -->
<!-- <property name="hibernate.hbm2ddl.auto">update</property> -->
</session-factory>
</hibernate-configuration>

@ -0,0 +1,15 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="table.BookEntity" table="book" schema="xianshu">
<id name="bookid" column="bookid"/>
<property name="bookname" column="bookname"/>
<property name="price" column="price"/>
<property name="category" column="category"/>
<property name="imageurl" column="imageurl"/>
<property name="sellerId" column="sellerID"/>
</class>
</hibernate-mapping>

@ -0,0 +1,13 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="table.OrderEntity" table="order" schema="xianshu">
<id name="orderId" column="orderId"/>
<property name="buyerId" column="BuyerID"/>
<property name="sellerId" column="sellerID"/>
<property name="bookId" column="bookID"/>
</class>
</hibernate-mapping>

@ -0,0 +1,12 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="table.ShopcartEntity" table="shopcart" schema="xianshu">
<id name="cartId" column="cartID"/>
<property name="userId" column="userID"/>
<property name="bookid" column="bookid"/>
</class>
</hibernate-mapping>

@ -0,0 +1,14 @@
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="table.UserEntity" table="user" schema="xianshu">
<id name="userId" column="userID"/>
<property name="userName" column="userName"/>
<property name="password" column="password"/>
<property name="school" column="school"/>
<property name="sex" column="sex"/>
</class>
</hibernate-mapping>

@ -0,0 +1,61 @@
package Connect;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import javax.swing.*;
import java.sql.*;
public class Connect {
private Statement sql=null;
private ResultSet result;
// private String url="jdbc:mysql://localhost:3306/userinfo?serverTimezone=GMT%2B8";
// private String user="root";
// private String passWord ="1996315211cjr";
private Connection con=null;
private static Connect connect=new Connect("jdbc:mysql://localhost:3306/userinfo?serverTimezone=GMT%2B8","root","123456");
// private Connect con=new Connect(url,user,passWord);
public static Connect getCon(){
return connect;
}
private Connect(String url, String user, String passWord){
try{
Class.forName("com.mysql.jdbc.Driver");
}
catch(Exception e){
System.out.print(e);
}
try{
con = DriverManager.getConnection(url,user,passWord);
}
catch(SQLException e){
System.out.println(e);
}
}
public int getUpdate(String str){
int insert=0;
try{
sql=con.createStatement();
insert=sql.executeUpdate(str);
}catch(SQLException e){
System.out.println(e);
}
return insert;
}
public ResultSet getResult(String str){
try{
sql=con.createStatement();
result=sql.executeQuery(str);
}catch(SQLException e){
System.out.println(e);
}
return result;
}
public static Session getConfig(){
Configuration configuration = new Configuration();//加载配置信息
configuration.configure();
SessionFactory sessionFactory=configuration.buildSessionFactory();
return sessionFactory.openSession();
}
}

@ -0,0 +1,92 @@
package test;
import table.BookEntity;
import org.hibernate.*;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.sql.Date;
import java.util.Iterator;
import java.util.List;
/**
*
*/
public class AddTest {
private SessionFactory sessionFactory;
private Session session;
private Transaction transaction;
@Before
public void init(){
//创建配置对象
Configuration config = new Configuration().configure();
//创建服务注册对象
// ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(config.getProperties()).build();使用这种方法会报错unkonw Entity 。。。。)
ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().configure().build();
//创建会话工厂对象
sessionFactory = config.buildSessionFactory(serviceRegistry);
//创建会话对象
session = sessionFactory.openSession();
//开启事务
transaction = session.beginTransaction();
}
@Test
public void testAddBook(){
BookEntity s = new BookEntity();
s.setBookid(7);
s.setBookname("s哈哈");
s.setPrice(10);
s.setCategory("英语");
session.save(s);//保存对象进入数据库
}
// @Test
public void testDeleteBook(){
BookEntity s =new BookEntity();
s.setBookid(5);
session.delete(s);
}
// @Test
public void testSearchBook(){
BookEntity s =new BookEntity();
//参数是一个字符串,是HQL的查询语句.注意此时的的UserU为大写,为对象的,而不是表的.
Query query = session.createQuery("from BookEntity s where s.bookid=1");
//使用List方法.
List bookList = query.list();
//迭代器去迭代.
for(Iterator iter = bookList.iterator(); iter.hasNext();)
{
BookEntity book =(BookEntity) iter.next();
System.out.println("id="+book.getBookid() + "price="+book.getPrice());
}
}
@After
public void destory(){
//提交事务
transaction.commit();
//关闭session
try {
session.close();
}catch(Exception e){
}
//关闭sessionFactory
sessionFactory.close();
}
}

@ -0,0 +1,50 @@
package test;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
import Connect.Connect;
public class UploadServlet extends HttpServlet{
private Connect con=Connect.getCon();
public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException {
request.setCharacterEncoding("gb2312");
Enumeration e=request.getParameterNames();
while(e.hasMoreElements()){
String name=(String)e.nextElement();
String value=request.getParameter(name);
System.out.println(name + "=" + value);
}
//String username=request.getParameter("username");
//String password=request.getParameter("password");
//String sex=request.getParameter("sex");
//String school=request.getParameter("school");
String bookname=request.getParameter("bookname");
String category=request.getParameter("category");
String price=request.getParameter("price");
//System.out.println(username);
//System.out.println(password);
//System.out.println(sex);
//System.out.println(school);
System.out.println(bookname);
System.out.println(category);
System.out.println(price);
response.setContentType("text/html;charset=gb2312");
PrintWriter out=response.getWriter();
//String sql="insert into user values("+"\""+username+"\""+","+password+","+"\""+school+"\""+","+"\""+sex+"\""+")";
// insert into user values(\"username\",password,\"school\",\"sex\")
/*System.out.println(sql);
int insert=con.getUpdate(sql);
if(insert!=0){
System.out.println("注册成功");
response.sendRedirect("huiyuan.html");
}*/
}
public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
doPost(request,response);
}
}

@ -7,24 +7,12 @@
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>RegisterServlet</servlet-name>
<servlet-class>Register.RegisterServlet</servlet-class>
<servlet-name>UploadServlet</servlet-name>
<servlet-class>test.UploadServlet</servlet-class>
</servlet>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>Register.LoginServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>RegisterServlet</servlet-name>
<url-pattern>/register.action</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/login.action</url-pattern>
<servlet-name>UploadServlet</servlet-name>
<url-pattern>/Upload.action</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>huiyuan.html</welcome-file>
</welcome-file-list>
</web-app>

@ -1,8 +1,8 @@
<%--
Created by IntelliJ IDEA.
User: dell
Date: 2019/10/22
Time: 20:58
User: TANGNAN
Date: 2020/1/2
Time: 14:21
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
@ -11,6 +11,6 @@
<title>$Title$</title>
</head>
<body>
hello word
$END$
</body>
</html>

Loading…
Cancel
Save