|
|
|
@ -39,7 +39,7 @@ import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_ETAG_COLU |
|
|
|
import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_FILE_NAME_COLUMN; |
|
|
|
import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_IS_PUBLIC_COLUMN; |
|
|
|
import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_KEY_COLUMN; |
|
|
|
import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_PUBLIC_KEY_COLUMN; |
|
|
|
import static org.thingsboard.server.dao.model.ModelConstants.PUBLIC_RESOURCE_KEY_COLUMN; |
|
|
|
import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_TABLE_NAME; |
|
|
|
import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_TENANT_ID_COLUMN; |
|
|
|
import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_TITLE_COLUMN; |
|
|
|
@ -81,8 +81,8 @@ public class TbResourceInfoEntity extends BaseSqlEntity<TbResourceInfo> implemen |
|
|
|
@Column(name = RESOURCE_IS_PUBLIC_COLUMN) |
|
|
|
private Boolean isPublic; |
|
|
|
|
|
|
|
@Column(name = RESOURCE_PUBLIC_KEY_COLUMN, unique = true, updatable = false) |
|
|
|
private String publicKey; |
|
|
|
@Column(name = PUBLIC_RESOURCE_KEY_COLUMN, unique = true, updatable = false) |
|
|
|
private String publicResourceKey; |
|
|
|
|
|
|
|
@Column(name = EXTERNAL_ID_PROPERTY) |
|
|
|
private UUID externalId; |
|
|
|
@ -104,7 +104,7 @@ public class TbResourceInfoEntity extends BaseSqlEntity<TbResourceInfo> implemen |
|
|
|
this.fileName = resource.getFileName(); |
|
|
|
this.descriptor = resource.getDescriptor(); |
|
|
|
this.isPublic = resource.isPublic(); |
|
|
|
this.publicKey = resource.getPublicKey(); |
|
|
|
this.publicResourceKey = resource.getPublicResourceKey(); |
|
|
|
this.externalId = getUuid(resource.getExternalId()); |
|
|
|
} |
|
|
|
|
|
|
|
@ -121,7 +121,7 @@ public class TbResourceInfoEntity extends BaseSqlEntity<TbResourceInfo> implemen |
|
|
|
resource.setFileName(fileName); |
|
|
|
resource.setDescriptor(descriptor); |
|
|
|
resource.setPublic(isPublic == null || isPublic); |
|
|
|
resource.setPublicKey(publicKey); |
|
|
|
resource.setPublicResourceKey(publicResourceKey); |
|
|
|
resource.setExternalId(getEntityId(externalId, TbResourceId::new)); |
|
|
|
return resource; |
|
|
|
} |
|
|
|
|