Commit 237b4ad2 authored by Matija Obreza's avatar Matija Obreza

Fix table names for hibernate.ejb.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy

parent 5d0ada75
......@@ -27,6 +27,7 @@ import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.OrderColumn;
import javax.persistence.Table;
import org.genesys.blocks.model.AuditedVersionedModel;
import org.genesys.blocks.model.Copyable;
......@@ -44,7 +45,8 @@ import org.hibernate.annotations.Type;
*
* @author mobreza
*/
@Entity(name = "RepositoryGallery")
@Entity
@Table(name = "repository_gallery")
public class ImageGallery extends AuditedVersionedModel implements AclAwareModel, Copyable<ImageGallery> {
/** The Constant serialVersionUID. */
......@@ -72,7 +74,7 @@ public class ImageGallery extends AuditedVersionedModel implements AclAwareModel
/** The images. */
@ManyToMany(cascade = { CascadeType.REFRESH })
@JoinTable(name = "RepositoryGalleryImage", joinColumns = @JoinColumn(name = "galleryId"), inverseJoinColumns = @JoinColumn(name = "imageId"))
@JoinTable(name = "repository_gallery_image", joinColumns = @JoinColumn(name = "galleryId"), inverseJoinColumns = @JoinColumn(name = "imageId"))
@OrderColumn(name = "position")
private List<RepositoryImage> images;
......
......@@ -23,19 +23,15 @@ import javax.persistence.PrePersist;
import javax.persistence.Table;
import org.genesys.filerepository.metadata.DocumentMetadata;
import org.genesys.filerepository.metadata.ImageMetadata;
import org.hibernate.annotations.Type;
// TODO: Auto-generated Javadoc
/**
* An {@link RepositoryDocument} is an graphics file in one of the supported
* image formats (PNG and JPG). It extends the {@link RepositoryFile} by
* including image-specific metadata defined in {@link ImageMetadata}.
* An {@link RepositoryDocument} is a text document in the repository.
*
* @author mobreza
*/
@Entity
@Table
@Table(name = "repository_document")
public class RepositoryDocument extends RepositoryFile implements DocumentMetadata {
/** The Constant serialVersionUID. */
......
......@@ -48,7 +48,7 @@ import org.hibernate.annotations.Type;
* The RepositoryFile.
*/
@Entity
@Table(name = "RepositoryFile",
@Table(name = "repository_file",
// indexes
indexes = { @Index(unique = false, columnList = "path", name = "IX_repoFile_path") }
// unique
......@@ -61,7 +61,7 @@ public class RepositoryFile extends AuditedVersionedModelWithoutId implements Ac
/** The id. */
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.TABLE)
@Column(unique = true, nullable = false, length = 20)
private Long id = InMemoryIdGenerator.nextId();
......@@ -72,11 +72,11 @@ public class RepositoryFile extends AuditedVersionedModelWithoutId implements Ac
/** The path. */
// Path in the repository
@Column(nullable = false)
@Column(nullable = false, length = 250)
private String path;
/** The original filename as provided by the end user. */
@Column(nullable = false)
@Column(nullable = false, length = 250)
private String originalFilename;
/** Extension based on originalFilename. */
......
......@@ -26,7 +26,6 @@ import javax.persistence.Transient;
import org.genesys.filerepository.metadata.ImageMetadata;
// TODO: Auto-generated Javadoc
/**
* An {@link RepositoryImage} is an graphics file in one of the supported image
* formats (PNG and JPG). It extends the {@link RepositoryFile} by including
......@@ -35,7 +34,7 @@ import org.genesys.filerepository.metadata.ImageMetadata;
* @author mobreza
*/
@Entity
@Table
@Table(name="repository_image")
public class RepositoryImage extends RepositoryFile implements ImageMetadata {
/** The Constant serialVersionUID. */
......
......@@ -20,7 +20,6 @@ import java.util.List;
import java.util.UUID;
import org.genesys.filerepository.RepositoryPersistence;
import org.genesys.filerepository.model.RepositoryFile;
import org.genesys.filerepository.model.RepositoryImage;
import org.springframework.stereotype.Repository;
......@@ -40,11 +39,11 @@ public interface RepositoryImagePersistence extends RepositoryPersistence<Reposi
RepositoryImage findByUuid(UUID uuid);
/**
* Find by uuid and version
*
* @param fileUuid
* @param version
* @return
* Find by uuid and version.
*
* @param fileUuid the file uuid
* @param version the version
* @return the repository image
*/
RepositoryImage findByUuidAndVersion(UUID fileUuid, int version);
......
......@@ -81,8 +81,9 @@ public interface RepositoryService {
RepositoryFile getFile(UUID fileUuid) throws NoSuchRepositoryFileException;
/**
* Get repository file by its UUID and version
* Get repository file by its UUID and version.
*
* @param <T> the generic type
* @param fileUuid the file uuid
* @param version the record version
* @return the file
......@@ -140,7 +141,6 @@ public interface RepositoryService {
* Update file metadata. The update is based on the record UUID.
*
* @param <T> the generic type
* @param uuid UUID of the repository file
* @param fileData the file data
* @return the updated RepositoryFile
* @throws NoSuchRepositoryFileException when file is not available in the
......@@ -151,6 +151,7 @@ public interface RepositoryService {
/**
* Update file bytes.
*
* @param <T> the generic type
* @param fileData the file data
* @param contentType the content type
* @param bytes the data
......@@ -239,7 +240,6 @@ public interface RepositoryService {
/**
* Update image metadata. The update is based on the record UUID.
*
* @param uuid Repository image UUID
* @param imageData the file metadata
* @return the updated metadata
* @throws NoSuchRepositoryFileException when file is not available in the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment