Class PathConverter
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.model.PathConverter
-
- All Implemented Interfaces:
javax.persistence.AttributeConverter<java.nio.file.Path,java.lang.String>
public class PathConverter extends java.lang.Object implements javax.persistence.AttributeConverter<java.nio.file.Path,java.lang.String>
Converts aPath
to aString
before persisting a value to a column in a database. Allows us to store a the absolute path to a file instead of trying to store the file in the relational database.
-
-
Constructor Summary
Constructors Constructor Description PathConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
convertToDatabaseColumn(java.nio.file.Path attribute)
java.nio.file.Path
convertToEntityAttribute(java.lang.String dbData)
-
-
-
Method Detail
-
convertToDatabaseColumn
public java.lang.String convertToDatabaseColumn(java.nio.file.Path attribute)
- Specified by:
convertToDatabaseColumn
in interfacejavax.persistence.AttributeConverter<java.nio.file.Path,java.lang.String>
-
convertToEntityAttribute
public java.nio.file.Path convertToEntityAttribute(java.lang.String dbData)
- Specified by:
convertToEntityAttribute
in interfacejavax.persistence.AttributeConverter<java.nio.file.Path,java.lang.String>
-
-