Merge branch 'master' of http://bdgit.educoder.net/p43281075/pjr4z27u5
commit
2cfd1ee0a1
@ -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 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.
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>
|
Binary file not shown.
@ -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>
|
Binary file not shown.
@ -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>
|
Binary file not shown.
@ -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>
|
Binary file not shown.
@ -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>
|
Binary file not shown.
Binary file not shown.
@ -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>
|
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>
|
Binary file not shown.
@ -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>
|
Binary file not shown.
@ -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>
|
Binary file not shown.
@ -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>
|
Binary file not shown.
@ -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>
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,60 @@
|
||||
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","1996315211cjr");
|
||||
// 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,86 @@
|
||||
package JaveBean;
|
||||
|
||||
public class Book {
|
||||
private int bookId;
|
||||
private String bookname;
|
||||
private Double price;
|
||||
private String category;
|
||||
private String imageurl;
|
||||
private Integer sellerId;
|
||||
|
||||
public int getBookId() {
|
||||
return bookId;
|
||||
}
|
||||
|
||||
public void setBookId(int bookId) {
|
||||
this.bookId = bookId;
|
||||
}
|
||||
|
||||
public String getBookname() {
|
||||
return bookname;
|
||||
}
|
||||
|
||||
public void setBookname(String bookname) {
|
||||
this.bookname = bookname;
|
||||
}
|
||||
|
||||
public Double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(Double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getImageurl() {
|
||||
return imageurl;
|
||||
}
|
||||
|
||||
public void setImageurl(String imageurl) {
|
||||
this.imageurl = imageurl;
|
||||
}
|
||||
|
||||
public Integer getSellerId() {
|
||||
return sellerId;
|
||||
}
|
||||
|
||||
public void setSellerId(Integer sellerId) {
|
||||
this.sellerId = sellerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
Book book = (Book) o;
|
||||
|
||||
if (bookId != book.bookId) return false;
|
||||
if (bookname != null ? !bookname.equals(book.bookname) : book.bookname != null) return false;
|
||||
if (price != null ? !price.equals(book.price) : book.price != null) return false;
|
||||
if (category != null ? !category.equals(book.category) : book.category != null) return false;
|
||||
if (imageurl != null ? !imageurl.equals(book.imageurl) : book.imageurl != null) return false;
|
||||
if (sellerId != null ? !sellerId.equals(book.sellerId) : book.sellerId != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = bookId;
|
||||
result = 31 * result + (bookname != null ? bookname.hashCode() : 0);
|
||||
result = 31 * result + (price != null ? price.hashCode() : 0);
|
||||
result = 31 * result + (category != null ? category.hashCode() : 0);
|
||||
result = 31 * result + (imageurl != null ? imageurl.hashCode() : 0);
|
||||
result = 31 * result + (sellerId != null ? sellerId.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package JaveBean;
|
||||
|
||||
public class Order {
|
||||
private int orderId;
|
||||
private Integer buyerId;
|
||||
private Integer sellerId;
|
||||
private int bookId;
|
||||
|
||||
public int getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(int orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Integer getBuyerId() {
|
||||
return buyerId;
|
||||
}
|
||||
|
||||
public void setBuyerId(Integer buyerId) {
|
||||
this.buyerId = buyerId;
|
||||
}
|
||||
|
||||
public Integer getSellerId() {
|
||||
return sellerId;
|
||||
}
|
||||
|
||||
public void setSellerId(Integer sellerId) {
|
||||
this.sellerId = sellerId;
|
||||
}
|
||||
|
||||
public int getBookId() {
|
||||
return bookId;
|
||||
}
|
||||
|
||||
public void setBookId(int bookId) {
|
||||
this.bookId = bookId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
Order order = (Order) o;
|
||||
|
||||
if (orderId != order.orderId) return false;
|
||||
if (bookId != order.bookId) return false;
|
||||
if (buyerId != null ? !buyerId.equals(order.buyerId) : order.buyerId != null) return false;
|
||||
if (sellerId != null ? !sellerId.equals(order.sellerId) : order.sellerId != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = orderId;
|
||||
result = 31 * result + (buyerId != null ? buyerId.hashCode() : 0);
|
||||
result = 31 * result + (sellerId != null ? sellerId.hashCode() : 0);
|
||||
result = 31 * result + bookId;
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package JaveBean;
|
||||
|
||||
public class Shopcar {
|
||||
private int userId;
|
||||
private Integer bookid;
|
||||
private Integer number;
|
||||
private int itemid;
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Integer getBookid() {
|
||||
return bookid;
|
||||
}
|
||||
|
||||
public void setBookid(Integer bookid) {
|
||||
this.bookid = bookid;
|
||||
}
|
||||
|
||||
public Integer getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(Integer number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
Shopcar shopcar = (Shopcar) o;
|
||||
|
||||
if (userId != shopcar.userId) return false;
|
||||
if (bookid != null ? !bookid.equals(shopcar.bookid) : shopcar.bookid != null) return false;
|
||||
if (number != null ? !number.equals(shopcar.number) : shopcar.number != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = userId;
|
||||
result = 31 * result + (bookid != null ? bookid.hashCode() : 0);
|
||||
result = 31 * result + (number != null ? number.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
public int getItemid() {
|
||||
return itemid;
|
||||
}
|
||||
|
||||
public void setItemid(int itemid) {
|
||||
this.itemid = itemid;
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
package JaveBean;
|
||||
|
||||
public class User {
|
||||
private String username;
|
||||
private String password;
|
||||
private String school;
|
||||
private String sex;
|
||||
private int userId;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getSchool() {
|
||||
return school;
|
||||
}
|
||||
|
||||
public void setSchool(String school) {
|
||||
this.school = school;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
User user = (User) o;
|
||||
|
||||
if (userId != user.userId) return false;
|
||||
if (username != null ? !username.equals(user.username) : user.username != null) return false;
|
||||
if (password != null ? !password.equals(user.password) : user.password != null) return false;
|
||||
if (school != null ? !school.equals(user.school) : user.school != null) return false;
|
||||
if (sex != null ? !sex.equals(user.sex) : user.sex != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = username != null ? username.hashCode() : 0;
|
||||
result = 31 * result + (password != null ? password.hashCode() : 0);
|
||||
result = 31 * result + (school != null ? school.hashCode() : 0);
|
||||
result = 31 * result + (sex != null ? sex.hashCode() : 0);
|
||||
result = 31 * result + userId;
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
package ShopCar;
|
||||
|
||||
import Connect.Connect;
|
||||
import JaveBean.Shopcar;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class ShopCartServlet extends HttpServlet {
|
||||
@Override
|
||||
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
if(req.getServletPath().equals("/addBook.do")){
|
||||
addBook(req, resp);
|
||||
}else if(req.getServletPath().equals("/deleteBook.do")){
|
||||
deleteBook(req, resp);
|
||||
}else if(req.getServletPath().equals("/showCart.do")){
|
||||
showShopcar(req,resp);
|
||||
}
|
||||
}
|
||||
private void showShopcar(HttpServletRequest req, HttpServletResponse resp) {
|
||||
HttpSession session=req.getSession();
|
||||
Object obj=session.getAttribute("userID");
|
||||
int userId = 0;
|
||||
if(obj!=null) {
|
||||
userId = (int) obj;
|
||||
System.out.println("userID是"+userId);
|
||||
}
|
||||
Session hSession=Connect.getConfig();
|
||||
Transaction tx=hSession.beginTransaction();
|
||||
String hql = "FROM Shopcar WHERE userId=:userid";
|
||||
Query query = hSession.createQuery(hql);
|
||||
query.setParameter("userid",userId);
|
||||
tx.commit();
|
||||
List results = query.list();
|
||||
System.out.println("购物车中一共有"+results.size());
|
||||
Iterator it=results.iterator();
|
||||
while(it.hasNext()){
|
||||
Shopcar shopcar= (Shopcar) it.next();
|
||||
System.out.println("Bookid"+shopcar.getBookid());
|
||||
System.out.println("Itemid"+shopcar.getItemid());
|
||||
System.out.println("useid"+shopcar.getUserId());
|
||||
}
|
||||
}
|
||||
private void addBook(HttpServletRequest req, HttpServletResponse resp){
|
||||
HttpSession session=req.getSession();
|
||||
Object obj=session.getAttribute("userID");
|
||||
int bookID=10;
|
||||
int userId = 0;
|
||||
if(obj!=null) {
|
||||
userId = (int) obj;
|
||||
System.out.println("userID是"+userId);
|
||||
}
|
||||
Session hSession= Connect.getConfig();
|
||||
if(userId!=0) {
|
||||
System.out.println(" this is ");
|
||||
Transaction tx=hSession.beginTransaction();
|
||||
Shopcar shopCar=new Shopcar();
|
||||
shopCar.setUserId(userId);
|
||||
shopCar.setBookid(bookID);
|
||||
shopCar.setNumber(10);
|
||||
hSession.save(shopCar);
|
||||
tx.commit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
doPost(req, resp);
|
||||
}
|
||||
|
||||
private void deleteBook(HttpServletRequest req,HttpServletResponse resp){
|
||||
HttpSession session=req.getSession();
|
||||
Object obj=session.getAttribute("userID");
|
||||
int bookID=10;
|
||||
int userId = 0;
|
||||
if(obj!=null) {
|
||||
userId = (int) obj;
|
||||
System.out.println("userID是"+userId);
|
||||
}
|
||||
Session hSession= Connect.getConfig();
|
||||
if(userId!=0) {
|
||||
Transaction tx1=hSession.beginTransaction();
|
||||
String hql = "FROM Shopcar WHERE bookid=:bookid AND userId=:userid";
|
||||
Query query = hSession.createQuery(hql);
|
||||
query.setParameter("bookid",bookID);
|
||||
query.setParameter("userid",userId);
|
||||
List results = query.list();
|
||||
tx1.commit();
|
||||
if(results.size()>0){
|
||||
Transaction tx2=hSession.beginTransaction();
|
||||
Shopcar deleteItem= (Shopcar) results.get(0);
|
||||
hSession.delete(deleteItem);
|
||||
tx2.commit();
|
||||
}else{
|
||||
System.out.println("无法删除");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue