esoe
1 year ago
14 changed files with 2 additions and 81 deletions
@ -1,36 +0,0 @@
@@ -1,36 +0,0 @@
|
||||
package ru.molokoin.home.entities; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
import jakarta.persistence.Basic; |
||||
import jakarta.persistence.Column; |
||||
import jakarta.persistence.Entity; |
||||
import jakarta.persistence.GeneratedValue; |
||||
import jakarta.persistence.GenerationType; |
||||
import jakarta.persistence.Id; |
||||
import jakarta.persistence.Lob; |
||||
import jakarta.persistence.NamedQueries; |
||||
import jakarta.persistence.NamedQuery; |
||||
import jakarta.persistence.Table; |
||||
/** |
||||
* Класс сущности, |
||||
* хранит сведения о файлах размещенных на сервере |
||||
* и ссылку на размещенный файл |
||||
*/ |
||||
@Entity |
||||
@Table(name = "Medias") |
||||
@NamedQueries({ |
||||
@NamedQuery(name = "Medias.findAll", |
||||
query = "SELECT m FROM Media m") |
||||
}) |
||||
public class Media implements Serializable{ |
||||
@Id //уникальный идентификатор ресурса
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY) |
||||
@Basic(optional = false) //не может быть null
|
||||
@Column(name = "id") |
||||
private Integer id;// PRIMARY KEY AUTO_INCREMENT
|
||||
private String name;// name varchar(300)
|
||||
private String type;// varchar(10)
|
||||
private String description;// varchar(1000)
|
||||
private Integer parent;// DEFAULT (0)
|
||||
} |
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<persistence xmlns="https://jakarta.ee/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:schemalocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"> |
||||
<persistence-unit name="Repository" transaction-type="JTA"> |
||||
<description>Подключение к базе molokoin.ru:3306/home</description> |
||||
<jta-data-source>java:/home</jta-data-source> |
||||
<!-- <class>ru.molokoin.home.entities.Media</class> --> |
||||
<exclude-unlisted-classes>true</exclude-unlisted-classes> |
||||
</persistence-unit> |
||||
</persistence> |
@ -1,12 +0,0 @@
@@ -1,12 +0,0 @@
|
||||
create database home; |
||||
|
||||
create table home.repository ( |
||||
id INT PRIMARY KEY AUTO_INCREMENT, |
||||
name varchar(300) not null, |
||||
type varchar(10), |
||||
description varchar(1000), |
||||
parent INT DEFAULT(0) |
||||
); |
||||
|
||||
ALTER TABLE home.repository ADD data LARGEBLOB; |
||||
|
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<persistence xmlns="https://jakarta.ee/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:schemalocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"> |
||||
<persistence-unit name="Repository" transaction-type="JTA"> |
||||
<description>Подключение к базе molokoin.ru:3306/home</description> |
||||
<jta-data-source>java:/home</jta-data-source> |
||||
<!-- <class>ru.molokoin.home.entities.Media</class> --> |
||||
<exclude-unlisted-classes>true</exclude-unlisted-classes> |
||||
</persistence-unit> |
||||
</persistence> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,9 +0,0 @@
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<persistence xmlns="https://jakarta.ee/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:schemalocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"> |
||||
<persistence-unit name="Repository" transaction-type="JTA"> |
||||
<description>Подключение к базе molokoin.ru:3306/home</description> |
||||
<jta-data-source>java:/home</jta-data-source> |
||||
<!-- <class>ru.molokoin.home.entities.Media</class> --> |
||||
<exclude-unlisted-classes>true</exclude-unlisted-classes> |
||||
</persistence-unit> |
||||
</persistence> |
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue