added persistence functionality (JPA with Hibernate ORM and PostgreSQL JDBC driver) to save hits data to postgres database

This commit is contained in:
Egor 2023-03-10 04:17:50 +03:00
parent 638916a160
commit 8e6d912eea
88 changed files with 101 additions and 14 deletions

View file

@ -0,0 +1,8 @@
<component name="ArtifactManager">
<artifact type="exploded-ear" name="web-lab3:ear exploded">
<output-path>$PROJECT_DIR$/out/artifacts/web_lab3_ear_exploded</output-path>
<root id="root">
<element id="javaee-facet-resources" facet="web-lab3/javaeeApplication/javaEEApplication" />
</root>
</artifact>
</component>

View file

@ -0,0 +1,8 @@
<component name="ArtifactManager">
<artifact type="exploded-ear" name="web-lab3.main:ear exploded">
<output-path>$PROJECT_DIR$/out/artifacts/web_lab3_main_ear_exploded</output-path>
<root id="root">
<element id="javaee-facet-resources" facet="web-lab3.main/javaeeApplication/javaEEApplication" />
</root>
</artifact>
</component>

12
.idea/dataSources.xml Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="helios postgres" uuid="1d89802b-1b14-4f1f-bdf1-c835d25f1fd2">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://pg:5432/studs</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

16
.idea/deployment.xml Normal file
View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
<serverData>
<paths name="helios">
<serverdata>
<mappings>
<mapping deploy="web\lab3\main" local="$PROJECT_DIR$/src/main" web="web\lab3\main" />
<mapping deploy="web\lab3\test" local="$PROJECT_DIR$/src/test" web="web\lab3\test" />
<mapping deploy="web\lab3" local="$PROJECT_DIR$" web="web\lab3" />
</mappings>
</serverdata>
</paths>
</serverData>
</component>
</project>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="https://jakarta.ee/xml/ns/persistence/orm"
version="3.0">
</entity-mappings>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"
version="3.0">
<persistence-unit name="default">
</persistence-unit>
</persistence>

14
.idea/webServers.xml Normal file
View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebServers">
<option name="servers">
<webServer id="c14c7a48-1f31-4ae7-816f-cf7bb40354cf" name="helios" url="http://helios.se.ifmo.ru">
<fileTransfer rootFolder="/home/studs/s316304" accessType="SFTP" host="helios.se.ifmo.ru" port="2222" sshConfigId="d2a90d61-c2d5-41f1-bfff-50b7f6ebca77" sshConfig="s316304@helios.se.ifmo.ru:2222 password">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" keepAliveTimeout="0" passiveMode="true" shareSSLContext="true" />
</advancedOptions>
</fileTransfer>
</webServer>
</option>
</component>
</project>

BIN
lib/cdi-api-javadoc.jar Normal file

Binary file not shown.

BIN
lib/cdi-api-sources.jar Normal file

Binary file not shown.

BIN
lib/cdi-api.jar Normal file

Binary file not shown.

BIN
lib/weld-api-javadoc.jar Normal file

Binary file not shown.

BIN
lib/weld-api-sources.jar Normal file

Binary file not shown.

BIN
lib/weld-api.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/weld-core-impl.jar Normal file

Binary file not shown.

BIN
lib/weld-core-javadoc.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/weld-core-jsf.jar Normal file

Binary file not shown.

BIN
lib/weld-core-sources.jar Normal file

Binary file not shown.

BIN
lib/weld-core.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/weld-se-core.jar Normal file

Binary file not shown.

BIN
lib/weld-se-sources.jar Normal file

Binary file not shown.

BIN
lib/weld-se.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/weld-servlet-core.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/weld-servlet.jar Normal file

Binary file not shown.

BIN
lib/weld-spi-javadoc.jar Normal file

Binary file not shown.

BIN
lib/weld-spi-sources.jar Normal file

Binary file not shown.

BIN
lib/weld-spi.jar Normal file

Binary file not shown.

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<application 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/application_8.xsd"
version="8">
</application>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
src/main/lib/cdi-api.jar Normal file

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.

BIN
src/main/lib/txw2-2.3.1.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
src/main/lib/weld-api.jar Normal file

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.

BIN
src/main/lib/weld-core.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
src/main/lib/weld-se.jar Normal file

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.

BIN
src/main/lib/weld-spi.jar Normal file

Binary file not shown.

View file

@ -3,5 +3,5 @@
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/beans_1_1.xsd"
bean-discovery-mode="all">
bean-discovery-mode="annotated">
</beans>

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
<persistence xmlns="https://jakarta.ee/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"
version="3.0">
<persistence-unit name="default">
</persistence-unit>

View file

@ -0,0 +1,15 @@
<?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"/>
<property name="connection.driver_class"/>
<!-- <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>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans 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/beans_1_1.xsd"
bean-discovery-mode="annotated">
</beans>