diff --git a/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java b/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java index 38793ce9d..890418707 100644 --- a/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java +++ b/server/src/main/java/org/eclipse/openvsx/ExtensionProcessor.java @@ -15,7 +15,9 @@ import com.fasterxml.jackson.databind.node.MissingNode; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; + import org.eclipse.openvsx.adapter.ExtensionQueryResult; import org.eclipse.openvsx.entities.ExtensionVersion; import org.eclipse.openvsx.entities.FileResource; @@ -23,7 +25,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.util.Pair; +import org.springframework.http.MediaType; +import org.xml.sax.SAXException; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.ByteArrayInputStream; import java.io.EOFException; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -295,17 +302,22 @@ private List getEngines(JsonNode node) { } public List getFileResources(ExtensionVersion extVersion) { - var resources = new ArrayList(); + readInputStream(); + var contentTypes = loadContentTypes(); var mappers = List.>of( this::getManifest, this::getReadme, this::getChangelog, this::getLicense, this::getIcon, this::getVsixManifest ); - mappers.forEach(mapper -> Optional.of(extVersion).map(mapper).ifPresent(resources::add)); - return resources; + return mappers.stream() + .map(mapper -> mapper.apply(extVersion)) + .filter(Objects::nonNull) + .map(resource -> setContentType(resource, contentTypes)) + .collect(Collectors.toList()); } public void processEachResource(ExtensionVersion extVersion, Consumer processor) { readInputStream(); + var contentTypes = loadContentTypes(); zipFile.stream() .filter(zipEntry -> !zipEntry.isDirectory()) .map(zipEntry -> { @@ -324,6 +336,7 @@ public void processEachResource(ExtensionVersion extVersion, Consumer loadContentTypes() { + var content = ArchiveUtil.readEntry(zipFile, "[Content_Types].xml"); + var contentTypes = new HashMap(); + try (var input = new ByteArrayInputStream(content)) { + var document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(input); + var elements = document.getDocumentElement().getElementsByTagName("Default"); + for(var i = 0; i < elements.getLength(); i++) { + var element = elements.item(i); + var attributes = element.getAttributes(); + var extension = attributes.getNamedItem("Extension").getTextContent(); + if(extension.startsWith(".")) { + extension = extension.substring(1); + } + + var contentType = attributes.getNamedItem("ContentType").getTextContent(); + contentTypes.put(extension, contentType); + } + } catch (IOException | ParserConfigurationException | SAXException e) { + logger.error("failed to read content types", e); + contentTypes.clear(); + } + + return contentTypes; + } + + private FileResource setContentType(FileResource resource, Map contentTypes) { + var fileExtension = FilenameUtils.getExtension(resource.getName()); + var contentType = contentTypes.getOrDefault(fileExtension, MediaType.APPLICATION_OCTET_STREAM_VALUE); + resource.setContentType(contentType); + return resource; + } + private void detectLicense(byte[] content, ExtensionVersion extVersion) { if (StringUtils.isEmpty(extVersion.getLicense())) { var detection = new LicenseDetection(); @@ -464,9 +509,7 @@ private Pair readFromAlternateNames(String[] names) { var entry = ArchiveUtil.getEntryIgnoreCase(zipFile, name); if (entry != null) { var bytes = ArchiveUtil.readEntry(zipFile, entry); - var lastSegmentIndex = entry.getName().lastIndexOf('/'); - var lastSegment = entry.getName().substring(lastSegmentIndex + 1); - return Pair.of(bytes, lastSegment); + return Pair.of(bytes, FilenameUtils.getName(entry.getName())); } } return null; @@ -506,12 +549,7 @@ protected FileResource getIcon(ExtensionVersion extVersion) { var icon = new FileResource(); icon.setExtension(extVersion); - var fileNameIndex = iconPath.lastIndexOf('/'); - var iconName = fileNameIndex >= 0 - ? iconPath.substring(fileNameIndex + 1) - : iconPath; - - icon.setName(iconName); + icon.setName(FilenameUtils.getName(iconPath)); icon.setType(FileResource.ICON); icon.setContent(bytes); return icon; diff --git a/server/src/main/java/org/eclipse/openvsx/ExtensionValidator.java b/server/src/main/java/org/eclipse/openvsx/ExtensionValidator.java index c542fc7c3..8179dd4a0 100644 --- a/server/src/main/java/org/eclipse/openvsx/ExtensionValidator.java +++ b/server/src/main/java/org/eclipse/openvsx/ExtensionValidator.java @@ -10,10 +10,6 @@ package org.eclipse.openvsx; import org.apache.commons.lang3.StringUtils; -import org.apache.tika.Tika; -import org.apache.tika.mime.MediaType; -import org.apache.tika.mime.MimeTypeException; -import org.apache.tika.mime.MimeTypes; import org.eclipse.openvsx.entities.ExtensionVersion; import org.eclipse.openvsx.entities.SemanticVersion; import org.eclipse.openvsx.json.NamespaceDetailsJson; @@ -21,8 +17,6 @@ import org.eclipse.openvsx.util.VersionAlias; import org.springframework.stereotype.Component; -import java.io.ByteArrayInputStream; -import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; @@ -82,22 +76,6 @@ public List validateNamespaceDetails(NamespaceDetailsJson json) { issues.add(new Issue("Invalid Twitter URL")); } - if(json.logoBytes != null) { - try (var in = new ByteArrayInputStream(json.logoBytes)) { - var tika = new Tika(); - var detectedType = tika.detect(in, json.logo); - var logoType = MimeTypes.getDefaultMimeTypes().getRegisteredMimeType(detectedType); - if(logoType != null) { - json.logo = "logo-" + json.name + "-" + System.currentTimeMillis() + logoType.getExtension(); - if(!logoType.getType().equals(MediaType.image("png")) && !logoType.getType().equals(MediaType.image("jpg"))) { - issues.add(new Issue("Namespace logo should be of png or jpg type")); - } - } - } catch (IOException | MimeTypeException e) { - issues.add(new Issue("Failed to read namespace logo")); - } - } - return issues; } diff --git a/server/src/main/java/org/eclipse/openvsx/LocalRegistryService.java b/server/src/main/java/org/eclipse/openvsx/LocalRegistryService.java index bcfefb34c..ff7de0bae 100644 --- a/server/src/main/java/org/eclipse/openvsx/LocalRegistryService.java +++ b/server/src/main/java/org/eclipse/openvsx/LocalRegistryService.java @@ -10,6 +10,8 @@ package org.eclipse.openvsx; import com.google.common.collect.Maps; +import jakarta.persistence.EntityManager; +import jakarta.transaction.Transactional; import org.apache.commons.lang3.StringUtils; import org.eclipse.openvsx.cache.CacheService; import org.eclipse.openvsx.eclipse.EclipseService; @@ -28,7 +30,6 @@ import org.springframework.cache.annotation.Cacheable; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.data.domain.PageRequest; -import org.springframework.data.elasticsearch.core.SearchHit; import org.springframework.data.elasticsearch.core.SearchHits; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -36,8 +37,6 @@ import org.springframework.stereotype.Component; import org.springframework.web.server.ResponseStatusException; -import jakarta.persistence.EntityManager; -import jakarta.transaction.Transactional; import java.io.InputStream; import java.util.*; import java.util.stream.Collectors; diff --git a/server/src/main/java/org/eclipse/openvsx/UserService.java b/server/src/main/java/org/eclipse/openvsx/UserService.java index 046d2d712..19ce107ed 100644 --- a/server/src/main/java/org/eclipse/openvsx/UserService.java +++ b/server/src/main/java/org/eclipse/openvsx/UserService.java @@ -11,6 +11,10 @@ import com.google.common.base.Joiner; import org.apache.commons.io.IOUtils; +import org.apache.tika.Tika; +import org.apache.tika.mime.MediaType; +import org.apache.tika.mime.MimeTypeException; +import org.apache.tika.mime.MimeTypes; import org.eclipse.openvsx.cache.CacheService; import org.eclipse.openvsx.entities.*; import org.eclipse.openvsx.json.AccessTokenJson; @@ -221,6 +225,23 @@ public ResultJson updateNamespaceDetails(NamespaceDetailsJson details) { throw new ErrorResultException(message); } + String contentType = null; + if(details.logoBytes != null) { + try (var in = new ByteArrayInputStream(details.logoBytes)) { + var tika = new Tika(); + contentType = tika.detect(in, details.logo); + var logoType = MimeTypes.getDefaultMimeTypes().getRegisteredMimeType(contentType); + if(logoType != null) { + details.logo = "logo-" + details.name + "-" + System.currentTimeMillis() + logoType.getExtension(); + if(!logoType.getType().equals(MediaType.image("png")) && !logoType.getType().equals(MediaType.image("jpg"))) { + throw new ErrorResultException("Namespace logo should be of png or jpg type"); + } + } + } catch (IOException | MimeTypeException e) { + throw new ErrorResultException("Failed to read namespace logo"); + } + } + if(!Objects.equals(details.displayName, namespace.getDisplayName())) { namespace.setDisplayName(details.displayName); } @@ -259,11 +280,13 @@ public ResultJson updateNamespaceDetails(NamespaceDetailsJson details) { namespace.setLogoName(details.logo); namespace.setLogoBytes(details.logoBytes); + namespace.setLogoContentType(contentType); storeNamespaceLogo(namespace); } else if (namespace.getLogoStorageType() != null) { storageUtil.removeNamespaceLogo(namespace); namespace.setLogoName(null); namespace.setLogoBytes(null); + namespace.setLogoContentType(null); namespace.setLogoStorageType(null); } } diff --git a/server/src/main/java/org/eclipse/openvsx/adapter/LocalVSCodeService.java b/server/src/main/java/org/eclipse/openvsx/adapter/LocalVSCodeService.java index f69905f4c..9088c5f6e 100644 --- a/server/src/main/java/org/eclipse/openvsx/adapter/LocalVSCodeService.java +++ b/server/src/main/java/org/eclipse/openvsx/adapter/LocalVSCodeService.java @@ -423,7 +423,7 @@ private ResponseEntity browseFile( String version ) { if (resource.getStorageType().equals(FileResource.STORAGE_DB)) { - var headers = storageUtil.getFileResponseHeaders(resource.getName()); + var headers = storageUtil.getFileResponseHeaders(resource); return new ResponseEntity<>(resource.getContent(), headers, HttpStatus.OK); } else { var namespace = new Namespace(); diff --git a/server/src/main/java/org/eclipse/openvsx/entities/FileResource.java b/server/src/main/java/org/eclipse/openvsx/entities/FileResource.java index 19f7ca87d..34ec17e32 100644 --- a/server/src/main/java/org/eclipse/openvsx/entities/FileResource.java +++ b/server/src/main/java/org/eclipse/openvsx/entities/FileResource.java @@ -47,6 +47,8 @@ public class FileResource { @Basic(fetch = FetchType.LAZY) byte[] content; + String contentType; + @Column(length = 32) String storageType; @@ -90,6 +92,14 @@ public void setContent(byte[] content) { this.content = content; } + public String getContentType() { + return contentType; + } + + public void setContentType(String contentType) { + this.contentType = contentType; + } + public String getStorageType() { return storageType; } diff --git a/server/src/main/java/org/eclipse/openvsx/entities/Namespace.java b/server/src/main/java/org/eclipse/openvsx/entities/Namespace.java index 159e4e1f4..c816a876b 100644 --- a/server/src/main/java/org/eclipse/openvsx/entities/Namespace.java +++ b/server/src/main/java/org/eclipse/openvsx/entities/Namespace.java @@ -57,6 +57,8 @@ public class Namespace implements Serializable { @Column(length = 32) String logoStorageType; + String logoContentType; + @ElementCollection @MapKeyColumn(name = "provider") @Column(name = "social_link") @@ -133,6 +135,14 @@ public void setLogoStorageType(String logoStorageType) { this.logoStorageType = logoStorageType; } + public String getLogoContentType() { + return logoContentType; + } + + public void setLogoContentType(String logoContentType) { + this.logoContentType = logoContentType; + } + public String getWebsite() { return website; } @@ -206,6 +216,7 @@ public boolean equals(Object o) { && Objects.equals(logoName, namespace.logoName) && Arrays.equals(logoBytes, namespace.logoBytes) && Objects.equals(logoStorageType, namespace.logoStorageType) + && Objects.equals(logoContentType, namespace.logoContentType) && Objects.equals(socialLinks, namespace.socialLinks) && Objects.equals(extensions, namespace.extensions) && Objects.equals(memberships, namespace.memberships); @@ -214,7 +225,7 @@ public boolean equals(Object o) { @Override public int hashCode() { int result = Objects.hash(id, publicId, name, displayName, description, website, supportLink, logoName, - logoStorageType, socialLinks, extensions, memberships); + logoStorageType, logoContentType, socialLinks, extensions, memberships); result = 31 * result + Arrays.hashCode(logoBytes); return result; } diff --git a/server/src/main/java/org/eclipse/openvsx/migration/MigrationRunner.java b/server/src/main/java/org/eclipse/openvsx/migration/MigrationRunner.java index 0b530e7b7..c2e523c0a 100644 --- a/server/src/main/java/org/eclipse/openvsx/migration/MigrationRunner.java +++ b/server/src/main/java/org/eclipse/openvsx/migration/MigrationRunner.java @@ -46,6 +46,8 @@ public void run(HandlerJobRequest jobRequest) throws Exception { fixTargetPlatformMigration(); generateSha256ChecksumMigration(); extensionVersionSignatureMigration(); + setFileResourceContentTypeMigration(); + setNamespaceLogoContentTypeMigration(); } private void extractResourcesMigration() { @@ -89,4 +91,16 @@ private void extensionVersionSignatureMigration() { scheduler.enqueue(new HandlerJobRequest<>(GenerateKeyPairJobRequestHandler.class)); } } + + private void setFileResourceContentTypeMigration() { + var jobName = "SetFileResourceContentTypeMigration"; + var handler = SetFileResourceContentTypeJobRequestHandler.class; + repositories.findNotMigratedFileResourceContentTypes().forEach(item -> migrations.enqueueMigration(jobName, handler, item)); + } + + private void setNamespaceLogoContentTypeMigration() { + var jobName = "SetNamespaceLogoContentTypeMigration"; + var handler = SetNamespaceLogoContentTypeJobRequestHandler.class; + repositories.findNotMigratedNamespaceLogoContentTypes().forEach(item -> migrations.enqueueMigration(jobName, handler, item)); + } } diff --git a/server/src/main/java/org/eclipse/openvsx/migration/MigrationService.java b/server/src/main/java/org/eclipse/openvsx/migration/MigrationService.java index 7f6759731..1cdeac184 100644 --- a/server/src/main/java/org/eclipse/openvsx/migration/MigrationService.java +++ b/server/src/main/java/org/eclipse/openvsx/migration/MigrationService.java @@ -9,6 +9,8 @@ * ****************************************************************************** */ package org.eclipse.openvsx.migration; +import jakarta.persistence.EntityManager; +import jakarta.transaction.Transactional; import org.eclipse.openvsx.entities.ExtensionVersion; import org.eclipse.openvsx.entities.FileResource; import org.eclipse.openvsx.entities.MigrationItem; @@ -25,8 +27,6 @@ import org.springframework.stereotype.Component; import org.springframework.web.client.RestTemplate; -import jakarta.persistence.EntityManager; -import jakarta.transaction.Transactional; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; diff --git a/server/src/main/java/org/eclipse/openvsx/migration/SetFileResourceContentTypeJobRequestHandler.java b/server/src/main/java/org/eclipse/openvsx/migration/SetFileResourceContentTypeJobRequestHandler.java new file mode 100644 index 000000000..c36c69170 --- /dev/null +++ b/server/src/main/java/org/eclipse/openvsx/migration/SetFileResourceContentTypeJobRequestHandler.java @@ -0,0 +1,68 @@ +/** ****************************************************************************** + * Copyright (c) 2022 Precies. Software Ltd and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * ****************************************************************************** */ +package org.eclipse.openvsx.migration; + +import org.eclipse.openvsx.ExtensionProcessor; +import org.eclipse.openvsx.entities.FileResource; +import org.eclipse.openvsx.util.NamingUtil; +import org.jobrunr.jobs.annotations.Job; +import org.jobrunr.jobs.lambdas.JobRequestHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.AbstractMap; +import java.util.function.Consumer; + +@Component +@ConditionalOnProperty(value = "ovsx.data.mirror.enabled", havingValue = "false", matchIfMissing = true) +public class SetFileResourceContentTypeJobRequestHandler implements JobRequestHandler { + + protected final Logger logger = LoggerFactory.getLogger(SetFileResourceContentTypeJobRequestHandler.class); + + @Autowired + MigrationService migrations; + + @Autowired + SetFileResourceContentTypeJobService service; + + @Override + @Job(name = "Set content type for published file resources", retries = 3) + public void run(MigrationJobRequest jobRequest) throws Exception { + var extVersion = migrations.getExtension(jobRequest.getEntityId()); + logger.info("Set content type for: {}", NamingUtil.toLogFormat(extVersion)); + + var entry = migrations.getDownload(extVersion); + try(var extensionFile = migrations.getExtensionFile(entry)) { + try (var processor = new ExtensionProcessor(extensionFile)) { + Consumer consumer = resource -> { + var existingResource = service.updateExistingResource(extVersion, resource); + if (existingResource == null) { + return; + } + + var content = migrations.getContent(existingResource); + try (var resourceFile = migrations.getExtensionFile(new AbstractMap.SimpleEntry<>(existingResource, content))) { + migrations.removeFile(existingResource); + migrations.uploadFileResource(existingResource, resourceFile); + } catch (IOException e) { + throw new RuntimeException(e); + } + }; + + processor.getFileResources(extVersion).forEach(consumer); + processor.processEachResource(extVersion, consumer); + } + } + } +} diff --git a/server/src/main/java/org/eclipse/openvsx/migration/SetFileResourceContentTypeJobService.java b/server/src/main/java/org/eclipse/openvsx/migration/SetFileResourceContentTypeJobService.java new file mode 100644 index 000000000..f17cc4e52 --- /dev/null +++ b/server/src/main/java/org/eclipse/openvsx/migration/SetFileResourceContentTypeJobService.java @@ -0,0 +1,35 @@ +/** ****************************************************************************** + * Copyright (c) 2022 Precies. Software Ltd and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * ****************************************************************************** */ +package org.eclipse.openvsx.migration; + +import org.eclipse.openvsx.entities.ExtensionVersion; +import org.eclipse.openvsx.entities.FileResource; +import org.eclipse.openvsx.repositories.RepositoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import jakarta.transaction.Transactional; + +@Component +public class SetFileResourceContentTypeJobService { + + @Autowired + RepositoryService repositories; + + @Transactional + public FileResource updateExistingResource(ExtensionVersion extVersion, FileResource resource) { + var existingResource = repositories.findFileByTypeAndName(extVersion, resource.getType(), resource.getName()); + if(existingResource != null) { + existingResource.setContentType(resource.getContentType()); + } + + return existingResource; + } +} diff --git a/server/src/main/java/org/eclipse/openvsx/migration/SetNamespaceLogoContentTypeJobRequestHandler.java b/server/src/main/java/org/eclipse/openvsx/migration/SetNamespaceLogoContentTypeJobRequestHandler.java new file mode 100644 index 000000000..73d148cea --- /dev/null +++ b/server/src/main/java/org/eclipse/openvsx/migration/SetNamespaceLogoContentTypeJobRequestHandler.java @@ -0,0 +1,51 @@ +/** ****************************************************************************** + * Copyright (c) 2023 Precies. Software Ltd and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * ****************************************************************************** */ +package org.eclipse.openvsx.migration; + +import org.apache.tika.Tika; +import org.jobrunr.jobs.annotations.Job; +import org.jobrunr.jobs.lambdas.JobRequestHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Component; + +import java.nio.file.Files; +import java.util.AbstractMap; + +@Component +@ConditionalOnProperty(value = "ovsx.data.mirror.enabled", havingValue = "false", matchIfMissing = true) +public class SetNamespaceLogoContentTypeJobRequestHandler implements JobRequestHandler { + + protected final Logger logger = LoggerFactory.getLogger(SetNamespaceLogoContentTypeJobRequestHandler.class); + + @Autowired + SetNamespaceLogoContentTypeJobService service; + + @Override + @Job(name = "Set content type for namespace logo", retries = 3) + public void run(MigrationJobRequest jobRequest) throws Exception { + var namespace = service.getNamespace(jobRequest.getEntityId()); + logger.info("Set logo content type for: {}", namespace.getName()); + + var logoBytes = service.getLogoContent(namespace); + try( + var logoFile = service.getNamespaceLogoFile(new AbstractMap.SimpleEntry<>(namespace, logoBytes)); + var in = Files.newInputStream(logoFile.getPath()) + ) { + var tika = new Tika(); + var contentType = tika.detect(in, namespace.getLogoName()); + namespace.setLogoContentType(contentType); + service.uploadNamespaceLogo(namespace, logoFile); + service.updateNamespace(namespace); + } + } +} diff --git a/server/src/main/java/org/eclipse/openvsx/migration/SetNamespaceLogoContentTypeJobService.java b/server/src/main/java/org/eclipse/openvsx/migration/SetNamespaceLogoContentTypeJobService.java new file mode 100644 index 000000000..05a47209a --- /dev/null +++ b/server/src/main/java/org/eclipse/openvsx/migration/SetNamespaceLogoContentTypeJobService.java @@ -0,0 +1,104 @@ +/** ****************************************************************************** + * Copyright (c) 2023 Precies. Software Ltd and others + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v. 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + * ****************************************************************************** */ +package org.eclipse.openvsx.migration; + +import jakarta.persistence.EntityManager; +import jakarta.transaction.Transactional; +import org.eclipse.openvsx.entities.ExtensionVersion; +import org.eclipse.openvsx.entities.FileResource; +import org.eclipse.openvsx.entities.Namespace; +import org.eclipse.openvsx.repositories.RepositoryService; +import org.eclipse.openvsx.storage.AzureBlobStorageService; +import org.eclipse.openvsx.storage.GoogleCloudStorageService; +import org.eclipse.openvsx.storage.IStorageService; +import org.eclipse.openvsx.util.TempFile; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.retry.annotation.Retryable; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; + +import java.io.IOException; +import java.nio.file.Files; +import java.util.Map; + +@Component +public class SetNamespaceLogoContentTypeJobService { + + @Autowired + AzureBlobStorageService azureStorage; + + @Autowired + GoogleCloudStorageService googleStorage; + + @Autowired + RestTemplate backgroundRestTemplate; + + @Autowired + EntityManager entityManager; + + public Namespace getNamespace(long entityId) { + return entityManager.find(Namespace.class, entityId); + } + + @Transactional + public byte[] getLogoContent(Namespace namespace) { + namespace = entityManager.merge(namespace); + return namespace.getLogoStorageType().equals(FileResource.STORAGE_DB) ? namespace.getLogoBytes() : null; + } + + @Retryable + public TempFile getNamespaceLogoFile(Map.Entry entry) throws IOException { + var namespaceLogoFile = new TempFile("migration-namespace-logo_", ""); + + var content = entry.getValue(); + if(content == null) { + var namespace = entry.getKey(); + var storage = getStorage(namespace); + var uri = storage.getNamespaceLogoLocation(namespace); + backgroundRestTemplate.execute("{namespaceLogoLocation}", HttpMethod.GET, null, response -> { + try(var out = Files.newOutputStream(namespaceLogoFile.getPath())) { + response.getBody().transferTo(out); + } + + return namespaceLogoFile; + }, Map.of("namespaceLogoLocation", uri.toString())); + } else { + Files.write(namespaceLogoFile.getPath(), content); + } + + return namespaceLogoFile; + } + + public IStorageService getStorage(Namespace namespace) { + var storages = Map.of( + FileResource.STORAGE_AZURE, azureStorage, + FileResource.STORAGE_GOOGLE, googleStorage + ); + + return storages.get(namespace.getLogoStorageType()); + } + + @Transactional + public void updateNamespace(Namespace namespace) { + entityManager.merge(namespace); + } + + @Retryable + public void uploadNamespaceLogo(Namespace namespace, TempFile logoFile) { + if(namespace.getLogoStorageType().equals(FileResource.STORAGE_DB)) { + return; + } + + var storage = getStorage(namespace); + storage.uploadNamespaceLogo(namespace, logoFile); + namespace.setLogoBytes(null); + } +} diff --git a/server/src/main/java/org/eclipse/openvsx/migration/SetPreReleaseJobRequestHandler.java b/server/src/main/java/org/eclipse/openvsx/migration/SetPreReleaseJobRequestHandler.java index 58dbed224..19fdacedc 100644 --- a/server/src/main/java/org/eclipse/openvsx/migration/SetPreReleaseJobRequestHandler.java +++ b/server/src/main/java/org/eclipse/openvsx/migration/SetPreReleaseJobRequestHandler.java @@ -22,7 +22,7 @@ @ConditionalOnProperty(value = "ovsx.data.mirror.enabled", havingValue = "false", matchIfMissing = true) public class SetPreReleaseJobRequestHandler implements JobRequestHandler { - protected final Logger logger = new JobRunrDashboardLogger(LoggerFactory.getLogger(ExtractResourcesJobRequestHandler.class)); + protected final Logger logger = new JobRunrDashboardLogger(LoggerFactory.getLogger(SetPreReleaseJobRequestHandler.class)); @Autowired MigrationService migrations; diff --git a/server/src/main/java/org/eclipse/openvsx/publish/ExtensionVersionIntegrityService.java b/server/src/main/java/org/eclipse/openvsx/publish/ExtensionVersionIntegrityService.java index 7d989d921..41fdc5d9e 100644 --- a/server/src/main/java/org/eclipse/openvsx/publish/ExtensionVersionIntegrityService.java +++ b/server/src/main/java/org/eclipse/openvsx/publish/ExtensionVersionIntegrityService.java @@ -28,6 +28,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.event.ApplicationStartedEvent; import org.springframework.context.event.EventListener; +import org.springframework.http.MediaType; import org.springframework.stereotype.Component; import jakarta.persistence.EntityManager; @@ -103,6 +104,7 @@ public FileResource generateSignature(FileResource download, TempFile extensionF resource.setExtension(download.getExtension()); resource.setName(NamingUtil.toFileFormat(download.getExtension(), ".sigzip")); resource.setType(FileResource.DOWNLOAD_SIG); + resource.setContentType(MediaType.TEXT_PLAIN_VALUE); var privateKeyParameters = new Ed25519PrivateKeyParameters(keyPair.getPrivateKey(), 0); try { diff --git a/server/src/main/java/org/eclipse/openvsx/publish/PublishExtensionVersionHandler.java b/server/src/main/java/org/eclipse/openvsx/publish/PublishExtensionVersionHandler.java index 6ebcd6989..14bc2b5fe 100644 --- a/server/src/main/java/org/eclipse/openvsx/publish/PublishExtensionVersionHandler.java +++ b/server/src/main/java/org/eclipse/openvsx/publish/PublishExtensionVersionHandler.java @@ -23,6 +23,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.MediaType; import org.springframework.retry.annotation.Retryable; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; @@ -263,6 +264,7 @@ private FileResource getSignatureResource(String signatureName, ExtensionVersion resource.setExtension(extVersion); resource.setName(signatureName); resource.setType(FileResource.DOWNLOAD_SIG); + resource.setContentType(MediaType.TEXT_PLAIN_VALUE); return resource; } } diff --git a/server/src/main/java/org/eclipse/openvsx/repositories/FileResourceJooqRepository.java b/server/src/main/java/org/eclipse/openvsx/repositories/FileResourceJooqRepository.java index cd9745c84..cf48f9e56 100644 --- a/server/src/main/java/org/eclipse/openvsx/repositories/FileResourceJooqRepository.java +++ b/server/src/main/java/org/eclipse/openvsx/repositories/FileResourceJooqRepository.java @@ -44,7 +44,12 @@ public List findByType(Collection extVersions, C } public List findAll(Collection extensionIds, Collection types) { - return dsl.select(FILE_RESOURCE.ID, FILE_RESOURCE.EXTENSION_ID, FILE_RESOURCE.NAME, FILE_RESOURCE.TYPE) + return dsl.select( + FILE_RESOURCE.ID, + FILE_RESOURCE.EXTENSION_ID, + FILE_RESOURCE.NAME, + FILE_RESOURCE.TYPE + ) .from(FILE_RESOURCE) .where(FILE_RESOURCE.EXTENSION_ID.in(extensionIds).and(FILE_RESOURCE.TYPE.in(types))) .fetch() @@ -52,7 +57,15 @@ public List findAll(Collection extensionIds, Collection findAllResources(long extVersionId, String prefix) { - return dsl.select(FILE_RESOURCE.ID, FILE_RESOURCE.EXTENSION_ID, FILE_RESOURCE.NAME, FILE_RESOURCE.TYPE, FILE_RESOURCE.STORAGE_TYPE, FILE_RESOURCE.CONTENT) + return dsl.select( + FILE_RESOURCE.ID, + FILE_RESOURCE.EXTENSION_ID, + FILE_RESOURCE.NAME, + FILE_RESOURCE.TYPE, + FILE_RESOURCE.STORAGE_TYPE, + FILE_RESOURCE.CONTENT, + FILE_RESOURCE.CONTENT_TYPE + ) .from(FILE_RESOURCE) .where(FILE_RESOURCE.TYPE.eq(FileResource.RESOURCE)) .and(FILE_RESOURCE.EXTENSION_ID.eq(extVersionId)) diff --git a/server/src/main/java/org/eclipse/openvsx/repositories/RepositoryService.java b/server/src/main/java/org/eclipse/openvsx/repositories/RepositoryService.java index cab73ff37..d6740e40c 100644 --- a/server/src/main/java/org/eclipse/openvsx/repositories/RepositoryService.java +++ b/server/src/main/java/org/eclipse/openvsx/repositories/RepositoryService.java @@ -453,6 +453,14 @@ public Streamable findNotMigratedSha256Checksums() { return findNotMigratedItems("V1_35__FileResource_Generate_Sha256_Checksum.sql"); } + public Streamable findNotMigratedFileResourceContentTypes() { + return findNotMigratedItems("V1_41__FileResource_ContentType.sql"); + } + + public Streamable findNotMigratedNamespaceLogoContentTypes() { + return findNotMigratedItems("V1_42__Namespace_Logo_ContentType.sql"); + } + private Streamable findNotMigratedItems(String migrationScript) { return migrationItemRepo.findByMigrationScriptAndMigrationScheduledFalseOrderById(migrationScript); } diff --git a/server/src/main/java/org/eclipse/openvsx/security/SecurityConfig.java b/server/src/main/java/org/eclipse/openvsx/security/SecurityConfig.java index 641b28ba4..c32613b4b 100644 --- a/server/src/main/java/org/eclipse/openvsx/security/SecurityConfig.java +++ b/server/src/main/java/org/eclipse/openvsx/security/SecurityConfig.java @@ -18,10 +18,6 @@ import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.authentication.Http403ForbiddenEntryPoint; -import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy; -import org.springframework.security.web.csrf.CookieCsrfTokenRepository; -import org.springframework.security.web.csrf.CsrfAuthenticationStrategy; -import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository; import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import org.springframework.security.web.util.matcher.RequestMatcher; diff --git a/server/src/main/java/org/eclipse/openvsx/storage/AzureBlobStorageService.java b/server/src/main/java/org/eclipse/openvsx/storage/AzureBlobStorageService.java index 7bc5ba302..2a0165608 100644 --- a/server/src/main/java/org/eclipse/openvsx/storage/AzureBlobStorageService.java +++ b/server/src/main/java/org/eclipse/openvsx/storage/AzureBlobStorageService.java @@ -68,30 +68,40 @@ protected BlobContainerClient getContainerClient() { @Override public void uploadFile(FileResource resource) { var blobName = getBlobName(resource); - uploadFile(resource.getContent(), resource.getName(), blobName); + uploadFile(resource.getContent(), resource.getName(), blobName, resource.getContentType()); } @Override public void uploadNamespaceLogo(Namespace namespace) { var blobName = getBlobName(namespace); - uploadFile(namespace.getLogoBytes(), namespace.getLogoName(), blobName); + uploadFile(namespace.getLogoBytes(), namespace.getLogoName(), blobName, namespace.getLogoContentType()); } - - protected void uploadFile(byte[] content, String fileName, String blobName) { + + @Override + public void uploadNamespaceLogo(Namespace namespace, TempFile logoFile) { + var blobName = getBlobName(namespace); + uploadFile(logoFile, namespace.getLogoName(), blobName, namespace.getLogoStorageType()); + } + + protected void uploadFile(byte[] content, String fileName, String blobName, String contentType) { if (StringUtils.isEmpty(serviceEndpoint)) { throw new IllegalStateException("Cannot upload file " + blobName + ": missing Azure blob service endpoint"); } + if(contentType.startsWith("text/")) { + contentType += "; charset=utf-8"; + } var blobClient = getContainerClient().getBlobClient(blobName); var headers = new BlobHttpHeaders(); - headers.setContentType(StorageUtil.getFileType(fileName).toString()); + headers.setContentType(contentType); if (fileName.endsWith(".vsix")) { headers.setContentDisposition("attachment; filename=\"" + fileName + "\""); } else { var cacheControl = StorageUtil.getCacheControl(fileName); headers.setCacheControl(cacheControl.getHeaderValue()); } + try (var dataStream = new ByteArrayInputStream(content)) { blobClient.upload(dataStream, content.length, true); blobClient.setHttpHeaders(headers); @@ -103,10 +113,10 @@ protected void uploadFile(byte[] content, String fileName, String blobName) { @Override public void uploadFile(FileResource resource, TempFile file) { var blobName = getBlobName(resource); - uploadFile(file, resource.getName(), blobName); + uploadFile(file, resource.getName(), blobName, resource.getContentType()); } - protected void uploadFile(TempFile file, String fileName, String blobName) { + protected void uploadFile(TempFile file, String fileName, String blobName, String contentType) { if (StringUtils.isEmpty(serviceEndpoint)) { throw new IllegalStateException("Cannot upload file " + blobName + ": missing Azure blob service endpoint"); @@ -114,7 +124,7 @@ protected void uploadFile(TempFile file, String fileName, String blobName) { var blobClient = getContainerClient().getBlobClient(blobName); var headers = new BlobHttpHeaders(); - headers.setContentType(StorageUtil.getFileType(fileName).toString()); + headers.setContentType(contentType); if (fileName.endsWith(".vsix")) { headers.setContentDisposition("attachment; filename=\"" + fileName + "\""); } else { diff --git a/server/src/main/java/org/eclipse/openvsx/storage/GoogleCloudStorageService.java b/server/src/main/java/org/eclipse/openvsx/storage/GoogleCloudStorageService.java index ad8090c78..cde4b9b8e 100644 --- a/server/src/main/java/org/eclipse/openvsx/storage/GoogleCloudStorageService.java +++ b/server/src/main/java/org/eclipse/openvsx/storage/GoogleCloudStorageService.java @@ -14,15 +14,14 @@ import com.google.cloud.storage.Storage; import com.google.cloud.storage.StorageOptions; import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; import org.eclipse.openvsx.entities.FileResource; import org.eclipse.openvsx.entities.Namespace; -import org.eclipse.openvsx.util.TargetPlatform; import org.eclipse.openvsx.util.TempFile; import org.eclipse.openvsx.util.UrlUtil; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.util.Pair; import org.springframework.stereotype.Component; -import org.apache.commons.lang3.StringUtils; import java.io.FileOutputStream; import java.io.IOException; @@ -72,7 +71,7 @@ public void uploadFile(FileResource resource) { + objectId + ": missing Google bucket id"); } - uploadFile(resource.getContent(), resource.getName(), objectId); + uploadFile(resource.getContent(), resource.getName(), objectId, resource.getContentType()); } @Override @@ -83,12 +82,27 @@ public void uploadNamespaceLogo(Namespace namespace) { + objectId + ": missing Google bucket id"); } - uploadFile(namespace.getLogoBytes(), namespace.getLogoName(), objectId); + uploadFile(namespace.getLogoBytes(), namespace.getLogoName(), objectId, namespace.getLogoContentType()); } - protected void uploadFile(byte[] content, String fileName, String objectId) { + @Override + public void uploadNamespaceLogo(Namespace namespace, TempFile logoFile) { + var objectId = getObjectId(namespace); + if (StringUtils.isEmpty(bucketId)) { + throw new IllegalStateException("Cannot upload file " + + objectId + ": missing Google bucket id"); + } + + uploadFile(logoFile, namespace.getLogoName(), objectId, namespace.getLogoStorageType()); + } + + protected void uploadFile(byte[] content, String fileName, String objectId, String contentType) { + if(contentType.startsWith("text/")) { + contentType += "; charset=utf-8"; + } + var blobInfoBuilder = BlobInfo.newBuilder(BlobId.of(bucketId, objectId)) - .setContentType(StorageUtil.getFileType(fileName).toString()); + .setContentType(contentType); if (fileName.endsWith(".vsix")) { blobInfoBuilder.setContentDisposition("attachment; filename=\"" + fileName + "\""); } else { @@ -106,12 +120,12 @@ public void uploadFile(FileResource resource, TempFile file) { + objectId + ": missing Google bucket id"); } - uploadFile(file, resource.getName(), objectId); + uploadFile(file, resource.getName(), objectId, resource.getContentType()); } - protected void uploadFile(TempFile file, String fileName, String objectId) { + protected void uploadFile(TempFile file, String fileName, String objectId, String contentType) { var blobInfoBuilder = BlobInfo.newBuilder(BlobId.of(bucketId, objectId)) - .setContentType(StorageUtil.getFileType(fileName).toString()); + .setContentType(contentType); if (fileName.endsWith(".vsix")) { blobInfoBuilder.setContentDisposition("attachment; filename=\"" + fileName + "\""); } else { diff --git a/server/src/main/java/org/eclipse/openvsx/storage/IStorageService.java b/server/src/main/java/org/eclipse/openvsx/storage/IStorageService.java index 01a09aff2..6f5f6a682 100644 --- a/server/src/main/java/org/eclipse/openvsx/storage/IStorageService.java +++ b/server/src/main/java/org/eclipse/openvsx/storage/IStorageService.java @@ -50,6 +50,11 @@ public interface IStorageService { */ void uploadNamespaceLogo(Namespace namespace); + /** + * Upload a namespace logo to the external storage. + */ + void uploadNamespaceLogo(Namespace namespace, TempFile logoFile); + /** * Remove a namespace logo from the external storage. */ diff --git a/server/src/main/java/org/eclipse/openvsx/storage/StorageUtil.java b/server/src/main/java/org/eclipse/openvsx/storage/StorageUtil.java index 63e897fc4..a5b83c804 100644 --- a/server/src/main/java/org/eclipse/openvsx/storage/StorageUtil.java +++ b/server/src/main/java/org/eclipse/openvsx/storage/StorageUtil.java @@ -11,26 +11,13 @@ package org.eclipse.openvsx.storage; import org.springframework.http.CacheControl; -import org.springframework.http.MediaType; -import java.net.URLConnection; import java.util.concurrent.TimeUnit; class StorageUtil { private StorageUtil(){} - static MediaType getFileType(String fileName) { - if (fileName.endsWith(".vsix")) - return MediaType.APPLICATION_OCTET_STREAM; - if (fileName.endsWith(".json")) - return MediaType.APPLICATION_JSON; - var contentType = URLConnection.guessContentTypeFromName(fileName); - if (contentType != null) - return MediaType.parseMediaType(contentType); - return MediaType.TEXT_PLAIN; - } - static CacheControl getCacheControl(String fileName) { // Files are requested with a version string in the URL, so their content cannot change return CacheControl.maxAge(30, TimeUnit.DAYS).cachePublic(); diff --git a/server/src/main/java/org/eclipse/openvsx/storage/StorageUtilService.java b/server/src/main/java/org/eclipse/openvsx/storage/StorageUtilService.java index 4cdfe552e..82812e1c9 100644 --- a/server/src/main/java/org/eclipse/openvsx/storage/StorageUtilService.java +++ b/server/src/main/java/org/eclipse/openvsx/storage/StorageUtilService.java @@ -27,6 +27,7 @@ import org.springframework.http.CacheControl; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; @@ -172,6 +173,23 @@ public void uploadNamespaceLogo(Namespace namespace) { namespace.setLogoStorageType(storageType); } + @Override + public void uploadNamespaceLogo(Namespace namespace, TempFile file) { + var storageType = getActiveStorageType(); + switch (storageType) { + case STORAGE_GOOGLE: + googleStorage.uploadNamespaceLogo(namespace, file); + break; + case STORAGE_AZURE: + azureStorage.uploadNamespaceLogo(namespace, file); + break; + default: + throw new RuntimeException("External storage is not available."); + } + + namespace.setLogoStorageType(storageType); + } + @Override public void removeFile(FileResource resource) { switch (resource.getStorageType()) { @@ -297,9 +315,13 @@ public void increaseDownloadCount(FileResource resource) { } } - public HttpHeaders getFileResponseHeaders(String fileName) { + public HttpHeaders getFileResponseHeaders(FileResource resource) { + return getFileResponseHeaders(resource.getName(), resource.getContentType()); + } + + private HttpHeaders getFileResponseHeaders(String fileName, String contentType) { var headers = new HttpHeaders(); - headers.setContentType(StorageUtil.getFileType(fileName)); + headers.setContentType(MediaType.parseMediaType(contentType)); if (fileName.endsWith(".vsix")) { headers.add("Content-Disposition", "attachment; filename=\"" + fileName + "\""); } else { @@ -312,7 +334,7 @@ public HttpHeaders getFileResponseHeaders(String fileName) { public ResponseEntity getFileResponse(FileResource resource) { resource = entityManager.merge(resource); if (resource.getStorageType().equals(STORAGE_DB)) { - var headers = getFileResponseHeaders(resource.getName()); + var headers = getFileResponseHeaders(resource); return new ResponseEntity<>(resource.getContent(), headers, HttpStatus.OK); } else { return ResponseEntity.status(HttpStatus.FOUND) @@ -326,7 +348,7 @@ public ResponseEntity getFileResponse(FileResource resource) { public ResponseEntity getNamespaceLogo(Namespace namespace) { namespace = entityManager.merge(namespace); if (namespace.getLogoStorageType().equals(STORAGE_DB)) { - var headers = getFileResponseHeaders(namespace.getLogoName()); + var headers = getFileResponseHeaders(namespace.getLogoName(), namespace.getLogoContentType()); return new ResponseEntity<>(namespace.getLogoBytes(), headers, HttpStatus.OK); } else { return ResponseEntity.status(HttpStatus.FOUND) diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/DefaultCatalog.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/DefaultCatalog.java index b4b72e243..3b15d2df6 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/DefaultCatalog.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/DefaultCatalog.java @@ -7,6 +7,7 @@ import java.util.Arrays; import java.util.List; +import org.jooq.Constants; import org.jooq.Schema; import org.jooq.impl.CatalogImpl; @@ -38,7 +39,16 @@ private DefaultCatalog() { @Override public final List getSchemas() { - return Arrays.asList( - Public.PUBLIC); + return Arrays.asList( + Public.PUBLIC + ); } + + /** + * A reference to the 3.18 minor release of the code generator. If this + * doesn't compile, it's because the runtime library uses an older minor + * release, namely: 3.18. You can turn off the generation of this reference + * by specifying /configuration/generator/generate/jooqVersionReference + */ + private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_18; } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java index 24597bc1a..73c4de007 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Indexes.java @@ -13,6 +13,7 @@ import org.eclipse.openvsx.jooq.tables.FlywaySchemaHistory; import org.eclipse.openvsx.jooq.tables.JobrunrBackgroundjobservers; import org.eclipse.openvsx.jooq.tables.JobrunrJobs; +import org.eclipse.openvsx.jooq.tables.JobrunrRecurringJobs; import org.eclipse.openvsx.jooq.tables.NamespaceMembership; import org.eclipse.openvsx.jooq.tables.PersistedLog; import org.eclipse.openvsx.jooq.tables.SpringSession; @@ -52,7 +53,8 @@ public class Indexes { public static final Index JOBRUNR_JOB_RCI_IDX = Internal.createIndex(DSL.name("jobrunr_job_rci_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.RECURRINGJOBID }, false); public static final Index JOBRUNR_JOB_SCHEDULED_AT_IDX = Internal.createIndex(DSL.name("jobrunr_job_scheduled_at_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.SCHEDULEDAT }, false); public static final Index JOBRUNR_JOB_SIGNATURE_IDX = Internal.createIndex(DSL.name("jobrunr_job_signature_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.JOBSIGNATURE }, false); - public static final Index JOBRUNR_JOB_UPDATED_AT_IDX = Internal.createIndex(DSL.name("jobrunr_job_updated_at_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.UPDATEDAT }, false); + public static final Index JOBRUNR_JOBS_STATE_UPDATED_IDX = Internal.createIndex(DSL.name("jobrunr_jobs_state_updated_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.STATE, JobrunrJobs.JOBRUNR_JOBS.UPDATEDAT }, false); + public static final Index JOBRUNR_RECURRING_JOB_CREATED_AT_IDX = Internal.createIndex(DSL.name("jobrunr_recurring_job_created_at_idx"), JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS, new OrderField[] { JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS.CREATEDAT }, false); public static final Index JOBRUNR_STATE_IDX = Internal.createIndex(DSL.name("jobrunr_state_idx"), JobrunrJobs.JOBRUNR_JOBS, new OrderField[] { JobrunrJobs.JOBRUNR_JOBS.STATE }, false); public static final Index NAMESPACE_MEMBERSHIP__NAMESPACE__IDX = Internal.createIndex(DSL.name("namespace_membership__namespace__idx"), NamespaceMembership.NAMESPACE_MEMBERSHIP, new OrderField[] { NamespaceMembership.NAMESPACE_MEMBERSHIP.NAMESPACE }, false); public static final Index NAMESPACE_MEMBERSHIP__USER_DATA__IDX = Internal.createIndex(DSL.name("namespace_membership__user_data__idx"), NamespaceMembership.NAMESPACE_MEMBERSHIP, new OrderField[] { NamespaceMembership.NAMESPACE_MEMBERSHIP.USER_DATA }, false); diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Keys.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Keys.java index e3ffdb499..d0f3aaa71 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Keys.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Keys.java @@ -74,7 +74,7 @@ /** - * A class modelling foreign key relationships and constraints of tables in + * A class modelling foreign key relationships and constraints of tables in * public. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @@ -104,13 +104,16 @@ public class Keys { public static final UniqueKey NAMESPACE_PKEY = Internal.createUniqueKey(Namespace.NAMESPACE, DSL.name("namespace_pkey"), new TableField[] { Namespace.NAMESPACE.ID }, true); public static final UniqueKey UNIQUE_NAMESPACE_PUBLIC_ID = Internal.createUniqueKey(Namespace.NAMESPACE, DSL.name("unique_namespace_public_id"), new TableField[] { Namespace.NAMESPACE.PUBLIC_ID }, true); public static final UniqueKey NAMESPACE_MEMBERSHIP_PKEY = Internal.createUniqueKey(NamespaceMembership.NAMESPACE_MEMBERSHIP, DSL.name("namespace_membership_pkey"), new TableField[] { NamespaceMembership.NAMESPACE_MEMBERSHIP.ID }, true); + public static final UniqueKey UNIQUE_NAMESPACE_MEMBERSHIP = Internal.createUniqueKey(NamespaceMembership.NAMESPACE_MEMBERSHIP, DSL.name("unique_namespace_membership"), new TableField[] { NamespaceMembership.NAMESPACE_MEMBERSHIP.USER_DATA, NamespaceMembership.NAMESPACE_MEMBERSHIP.NAMESPACE }, true); public static final UniqueKey PERSISTED_LOG_PKEY = Internal.createUniqueKey(PersistedLog.PERSISTED_LOG, DSL.name("persisted_log_pkey"), new TableField[] { PersistedLog.PERSISTED_LOG.ID }, true); public static final UniqueKey PERSONAL_ACCESS_TOKEN_PKEY = Internal.createUniqueKey(PersonalAccessToken.PERSONAL_ACCESS_TOKEN, DSL.name("personal_access_token_pkey"), new TableField[] { PersonalAccessToken.PERSONAL_ACCESS_TOKEN.ID }, true); public static final UniqueKey UKJEUD5MSSQBQKID58RD2K1INOF = Internal.createUniqueKey(PersonalAccessToken.PERSONAL_ACCESS_TOKEN, DSL.name("ukjeud5mssqbqkid58rd2k1inof"), new TableField[] { PersonalAccessToken.PERSONAL_ACCESS_TOKEN.VALUE }, true); public static final UniqueKey SHEDLOCK_PKEY = Internal.createUniqueKey(Shedlock.SHEDLOCK, DSL.name("shedlock_pkey"), new TableField[] { Shedlock.SHEDLOCK.NAME }, true); public static final UniqueKey SIGNATURE_KEY_PAIR_PKEY = Internal.createUniqueKey(SignatureKeyPair.SIGNATURE_KEY_PAIR, DSL.name("signature_key_pair_pkey"), new TableField[] { SignatureKeyPair.SIGNATURE_KEY_PAIR.ID }, true); + public static final UniqueKey SIGNATURE_KEY_PAIR_UNIQUE_PUBLIC_ID = Internal.createUniqueKey(SignatureKeyPair.SIGNATURE_KEY_PAIR, DSL.name("signature_key_pair_unique_public_id"), new TableField[] { SignatureKeyPair.SIGNATURE_KEY_PAIR.PUBLIC_ID }, true); public static final UniqueKey SPRING_SESSION_PK = Internal.createUniqueKey(SpringSession.SPRING_SESSION, DSL.name("spring_session_pk"), new TableField[] { SpringSession.SPRING_SESSION.PRIMARY_ID }, true); public static final UniqueKey SPRING_SESSION_ATTRIBUTES_PK = Internal.createUniqueKey(SpringSessionAttributes.SPRING_SESSION_ATTRIBUTES, DSL.name("spring_session_attributes_pk"), new TableField[] { SpringSessionAttributes.SPRING_SESSION_ATTRIBUTES.SESSION_PRIMARY_ID, SpringSessionAttributes.SPRING_SESSION_ATTRIBUTES.ATTRIBUTE_NAME }, true); + public static final UniqueKey UNIQUE_USER_DATA = Internal.createUniqueKey(UserData.USER_DATA, DSL.name("unique_user_data"), new TableField[] { UserData.USER_DATA.PROVIDER, UserData.USER_DATA.LOGIN_NAME }, true); public static final UniqueKey USER_DATA_PKEY = Internal.createUniqueKey(UserData.USER_DATA, DSL.name("user_data_pkey"), new TableField[] { UserData.USER_DATA.ID }, true); // ------------------------------------------------------------------------- diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Public.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Public.java index dc30fa262..3b29ce0e3 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Public.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Public.java @@ -69,22 +69,26 @@ public class Public extends SchemaImpl { public final AdminStatisticsExtensionsByRating ADMIN_STATISTICS_EXTENSIONS_BY_RATING = AdminStatisticsExtensionsByRating.ADMIN_STATISTICS_EXTENSIONS_BY_RATING; /** - * The table public.admin_statistics_publishers_by_extensions_published. + * The table + * public.admin_statistics_publishers_by_extensions_published. */ public final AdminStatisticsPublishersByExtensionsPublished ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED = AdminStatisticsPublishersByExtensionsPublished.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED; /** - * The table public.admin_statistics_top_most_active_publishing_users. + * The table + * public.admin_statistics_top_most_active_publishing_users. */ public final AdminStatisticsTopMostActivePublishingUsers ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS = AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS; /** - * The table public.admin_statistics_top_most_downloaded_extensions. + * The table + * public.admin_statistics_top_most_downloaded_extensions. */ public final AdminStatisticsTopMostDownloadedExtensions ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS = AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS; /** - * The table public.admin_statistics_top_namespace_extension_versions. + * The table + * public.admin_statistics_top_namespace_extension_versions. */ public final AdminStatisticsTopNamespaceExtensionVersions ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS = AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS; @@ -233,16 +237,29 @@ public Catalog getCatalog() { @Override public final List> getSequences() { - return Arrays.>asList( - Sequences.DOWNLOAD_ID_SEQ, + return Arrays.asList( + Sequences.ADMIN_STATISTICS_SEQ, + Sequences.AZURE_DOWNLOAD_COUNT_PROCESSED_ITEM_SEQ, + Sequences.DOWNLOAD_SEQ, Sequences.ENTITY_ACTIVE_STATE_ID_SEQ, - Sequences.FILE_RESOURCE_ID_SEQ, - Sequences.HIBERNATE_SEQUENCE); + Sequences.EXTENSION_REVIEW_SEQ, + Sequences.EXTENSION_SEQ, + Sequences.EXTENSION_VERSION_SEQ, + Sequences.FILE_RESOURCE_SEQ, + Sequences.HIBERNATE_SEQUENCE, + Sequences.MIGRATION_ITEM_SEQ, + Sequences.NAMESPACE_MEMBERSHIP_SEQ, + Sequences.NAMESPACE_SEQ, + Sequences.PERSISTED_LOG_SEQ, + Sequences.PERSONAL_ACCESS_TOKEN_SEQ, + Sequences.SIGNATURE_KEY_PAIR_SEQ, + Sequences.USER_DATA_SEQ + ); } @Override public final List> getTables() { - return Arrays.>asList( + return Arrays.asList( AdminStatistics.ADMIN_STATISTICS, AdminStatisticsExtensionsByRating.ADMIN_STATISTICS_EXTENSIONS_BY_RATING, AdminStatisticsPublishersByExtensionsPublished.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED, @@ -274,6 +291,7 @@ public final List> getTables() { SignatureKeyPair.SIGNATURE_KEY_PAIR, SpringSession.SPRING_SESSION, SpringSessionAttributes.SPRING_SESSION_ATTRIBUTES, - UserData.USER_DATA); + UserData.USER_DATA + ); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Sequences.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Sequences.java index dd70831f3..6a56171e4 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Sequences.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Sequences.java @@ -16,9 +16,19 @@ public class Sequences { /** - * The sequence public.download_id_seq + * The sequence public.admin_statistics_seq */ - public static final Sequence DOWNLOAD_ID_SEQ = Internal.createSequence("download_id_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, null, null, null, false, null); + public static final Sequence ADMIN_STATISTICS_SEQ = Internal.createSequence("admin_statistics_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); + + /** + * The sequence public.azure_download_count_processed_item_seq + */ + public static final Sequence AZURE_DOWNLOAD_COUNT_PROCESSED_ITEM_SEQ = Internal.createSequence("azure_download_count_processed_item_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); + + /** + * The sequence public.download_seq + */ + public static final Sequence DOWNLOAD_SEQ = Internal.createSequence("download_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); /** * The sequence public.entity_active_state_id_seq @@ -26,12 +36,62 @@ public class Sequences { public static final Sequence ENTITY_ACTIVE_STATE_ID_SEQ = Internal.createSequence("entity_active_state_id_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, null, null, null, false, null); /** - * The sequence public.file_resource_id_seq + * The sequence public.extension_review_seq + */ + public static final Sequence EXTENSION_REVIEW_SEQ = Internal.createSequence("extension_review_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); + + /** + * The sequence public.extension_seq */ - public static final Sequence FILE_RESOURCE_ID_SEQ = Internal.createSequence("file_resource_id_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, null, null, null, false, null); + public static final Sequence EXTENSION_SEQ = Internal.createSequence("extension_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); + + /** + * The sequence public.extension_version_seq + */ + public static final Sequence EXTENSION_VERSION_SEQ = Internal.createSequence("extension_version_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); + + /** + * The sequence public.file_resource_seq + */ + public static final Sequence FILE_RESOURCE_SEQ = Internal.createSequence("file_resource_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); /** * The sequence public.hibernate_sequence */ public static final Sequence HIBERNATE_SEQUENCE = Internal.createSequence("hibernate_sequence", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, null, null, null, false, null); + + /** + * The sequence public.migration_item_seq + */ + public static final Sequence MIGRATION_ITEM_SEQ = Internal.createSequence("migration_item_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); + + /** + * The sequence public.namespace_membership_seq + */ + public static final Sequence NAMESPACE_MEMBERSHIP_SEQ = Internal.createSequence("namespace_membership_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); + + /** + * The sequence public.namespace_seq + */ + public static final Sequence NAMESPACE_SEQ = Internal.createSequence("namespace_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); + + /** + * The sequence public.persisted_log_seq + */ + public static final Sequence PERSISTED_LOG_SEQ = Internal.createSequence("persisted_log_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); + + /** + * The sequence public.personal_access_token_seq + */ + public static final Sequence PERSONAL_ACCESS_TOKEN_SEQ = Internal.createSequence("personal_access_token_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); + + /** + * The sequence public.signature_key_pair_seq + */ + public static final Sequence SIGNATURE_KEY_PAIR_SEQ = Internal.createSequence("signature_key_pair_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); + + /** + * The sequence public.user_data_seq + */ + public static final Sequence USER_DATA_SEQ = Internal.createSequence("user_data_seq", Public.PUBLIC, SQLDataType.BIGINT.nullable(false), null, 50, null, null, false, null); } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Tables.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Tables.java index 0b40132a9..69175d5b7 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Tables.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/Tables.java @@ -55,22 +55,26 @@ public class Tables { public static final AdminStatisticsExtensionsByRating ADMIN_STATISTICS_EXTENSIONS_BY_RATING = AdminStatisticsExtensionsByRating.ADMIN_STATISTICS_EXTENSIONS_BY_RATING; /** - * The table public.admin_statistics_publishers_by_extensions_published. + * The table + * public.admin_statistics_publishers_by_extensions_published. */ public static final AdminStatisticsPublishersByExtensionsPublished ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED = AdminStatisticsPublishersByExtensionsPublished.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED; /** - * The table public.admin_statistics_top_most_active_publishing_users. + * The table + * public.admin_statistics_top_most_active_publishing_users. */ public static final AdminStatisticsTopMostActivePublishingUsers ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS = AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS; /** - * The table public.admin_statistics_top_most_downloaded_extensions. + * The table + * public.admin_statistics_top_most_downloaded_extensions. */ public static final AdminStatisticsTopMostDownloadedExtensions ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS = AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS; /** - * The table public.admin_statistics_top_namespace_extension_versions. + * The table + * public.admin_statistics_top_namespace_extension_versions. */ public static final AdminStatisticsTopNamespaceExtensionVersions ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS = AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS; diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatistics.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatistics.java index 004cd75bc..7ab14045b 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatistics.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatistics.java @@ -6,6 +6,7 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; @@ -13,11 +14,14 @@ import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function9; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row9; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -84,7 +88,8 @@ public Class getRecordType() { public final TableField PUBLISHERS = createField(DSL.name("publishers"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.admin_statistics.average_reviews_per_extension. + * The column + * public.admin_statistics.average_reviews_per_extension. */ public final TableField AVERAGE_REVIEWS_PER_EXTENSION = createField(DSL.name("average_reviews_per_extension"), SQLDataType.DOUBLE.nullable(false), this, ""); @@ -128,12 +133,12 @@ public AdminStatistics(Table child, ForeignKey getIndexes() { - return Arrays.asList(Indexes.UNIQUE_ADMIN_STATISTICS); + return Arrays.asList(Indexes.UNIQUE_ADMIN_STATISTICS); } @Override @@ -141,11 +146,6 @@ public UniqueKey getPrimaryKey() { return Keys.ADMIN_STATISTICS_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ADMIN_STATISTICS_PKEY); - } - @Override public AdminStatistics as(String alias) { return new AdminStatistics(DSL.name(alias), this); @@ -156,6 +156,11 @@ public AdminStatistics as(Name alias) { return new AdminStatistics(alias, this); } + @Override + public AdminStatistics as(Table alias) { + return new AdminStatistics(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -172,6 +177,14 @@ public AdminStatistics rename(Name name) { return new AdminStatistics(name, null); } + /** + * Rename this table + */ + @Override + public AdminStatistics rename(Table name) { + return new AdminStatistics(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row9 type methods // ------------------------------------------------------------------------- @@ -180,4 +193,19 @@ public AdminStatistics rename(Name name) { public Row9 fieldsRow() { return (Row9) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function9 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function9 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsExtensionsByRating.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsExtensionsByRating.java index ea408cbea..c0c2f56ef 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsExtensionsByRating.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsExtensionsByRating.java @@ -6,16 +6,20 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsExtensionsByRatingRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function3; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row3; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -33,7 +37,8 @@ public class AdminStatisticsExtensionsByRating extends TableImplpublic.admin_statistics_extensions_by_rating + * The reference instance of + * public.admin_statistics_extensions_by_rating */ public static final AdminStatisticsExtensionsByRating ADMIN_STATISTICS_EXTENSIONS_BY_RATING = new AdminStatisticsExtensionsByRating(); @@ -46,17 +51,20 @@ public Class getRecordType() { } /** - * The column public.admin_statistics_extensions_by_rating.admin_statistics_id. + * The column + * public.admin_statistics_extensions_by_rating.admin_statistics_id. */ public final TableField ADMIN_STATISTICS_ID = createField(DSL.name("admin_statistics_id"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.admin_statistics_extensions_by_rating.rating. + * The column + * public.admin_statistics_extensions_by_rating.rating. */ public final TableField RATING = createField(DSL.name("rating"), SQLDataType.INTEGER.nullable(false), this, ""); /** - * The column public.admin_statistics_extensions_by_rating.extensions. + * The column + * public.admin_statistics_extensions_by_rating.extensions. */ public final TableField EXTENSIONS = createField(DSL.name("extensions"), SQLDataType.INTEGER.nullable(false), this, ""); @@ -69,21 +77,24 @@ private AdminStatisticsExtensionsByRating(Name alias, Tablepublic.admin_statistics_extensions_by_rating table reference + * Create an aliased + * public.admin_statistics_extensions_by_rating table reference */ public AdminStatisticsExtensionsByRating(String alias) { this(DSL.name(alias), ADMIN_STATISTICS_EXTENSIONS_BY_RATING); } /** - * Create an aliased public.admin_statistics_extensions_by_rating table reference + * Create an aliased + * public.admin_statistics_extensions_by_rating table reference */ public AdminStatisticsExtensionsByRating(Name alias) { this(alias, ADMIN_STATISTICS_EXTENSIONS_BY_RATING); } /** - * Create a public.admin_statistics_extensions_by_rating table reference + * Create a public.admin_statistics_extensions_by_rating table + * reference */ public AdminStatisticsExtensionsByRating() { this(DSL.name("admin_statistics_extensions_by_rating"), null); @@ -95,16 +106,20 @@ public AdminStatisticsExtensionsByRating(Table child, Fore @Override public Schema getSchema() { - return Public.PUBLIC; + return aliased() ? null : Public.PUBLIC; } @Override public List> getReferences() { - return Arrays.>asList(Keys.ADMIN_STATISTICS_EXTENSIONS_BY_RATING__ADMIN_STATISTICS_EXTENSIONS_BY_RATING_FKEY); + return Arrays.asList(Keys.ADMIN_STATISTICS_EXTENSIONS_BY_RATING__ADMIN_STATISTICS_EXTENSIONS_BY_RATING_FKEY); } private transient AdminStatistics _adminStatistics; + /** + * Get the implicit join path to the public.admin_statistics + * table. + */ public AdminStatistics adminStatistics() { if (_adminStatistics == null) _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_EXTENSIONS_BY_RATING__ADMIN_STATISTICS_EXTENSIONS_BY_RATING_FKEY); @@ -122,6 +137,11 @@ public AdminStatisticsExtensionsByRating as(Name alias) { return new AdminStatisticsExtensionsByRating(alias, this); } + @Override + public AdminStatisticsExtensionsByRating as(Table alias) { + return new AdminStatisticsExtensionsByRating(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -138,6 +158,14 @@ public AdminStatisticsExtensionsByRating rename(Name name) { return new AdminStatisticsExtensionsByRating(name, null); } + /** + * Rename this table + */ + @Override + public AdminStatisticsExtensionsByRating rename(Table name) { + return new AdminStatisticsExtensionsByRating(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row3 type methods // ------------------------------------------------------------------------- @@ -146,4 +174,19 @@ public AdminStatisticsExtensionsByRating rename(Name name) { public Row3 fieldsRow() { return (Row3) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsPublishersByExtensionsPublished.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsPublishersByExtensionsPublished.java index 46e554e11..b9edf8896 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsPublishersByExtensionsPublished.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsPublishersByExtensionsPublished.java @@ -6,16 +6,20 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsPublishersByExtensionsPublishedRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function3; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row3; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -33,7 +37,8 @@ public class AdminStatisticsPublishersByExtensionsPublished extends TableImplpublic.admin_statistics_publishers_by_extensions_published + * The reference instance of + * public.admin_statistics_publishers_by_extensions_published */ public static final AdminStatisticsPublishersByExtensionsPublished ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED = new AdminStatisticsPublishersByExtensionsPublished(); @@ -46,17 +51,20 @@ public Class getRecordType } /** - * The column public.admin_statistics_publishers_by_extensions_published.admin_statistics_id. + * The column + * public.admin_statistics_publishers_by_extensions_published.admin_statistics_id. */ public final TableField ADMIN_STATISTICS_ID = createField(DSL.name("admin_statistics_id"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.admin_statistics_publishers_by_extensions_published.extensions_published. + * The column + * public.admin_statistics_publishers_by_extensions_published.extensions_published. */ public final TableField EXTENSIONS_PUBLISHED = createField(DSL.name("extensions_published"), SQLDataType.INTEGER.nullable(false), this, ""); /** - * The column public.admin_statistics_publishers_by_extensions_published.publishers. + * The column + * public.admin_statistics_publishers_by_extensions_published.publishers. */ public final TableField PUBLISHERS = createField(DSL.name("publishers"), SQLDataType.INTEGER.nullable(false), this, ""); @@ -69,21 +77,27 @@ private AdminStatisticsPublishersByExtensionsPublished(Name alias, Tablepublic.admin_statistics_publishers_by_extensions_published table reference + * Create an aliased + * public.admin_statistics_publishers_by_extensions_published + * table reference */ public AdminStatisticsPublishersByExtensionsPublished(String alias) { this(DSL.name(alias), ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED); } /** - * Create an aliased public.admin_statistics_publishers_by_extensions_published table reference + * Create an aliased + * public.admin_statistics_publishers_by_extensions_published + * table reference */ public AdminStatisticsPublishersByExtensionsPublished(Name alias) { this(alias, ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED); } /** - * Create a public.admin_statistics_publishers_by_extensions_published table reference + * Create a + * public.admin_statistics_publishers_by_extensions_published + * table reference */ public AdminStatisticsPublishersByExtensionsPublished() { this(DSL.name("admin_statistics_publishers_by_extensions_published"), null); @@ -95,16 +109,20 @@ public AdminStatisticsPublishersByExtensionsPublished(Table> getReferences() { - return Arrays.>asList(Keys.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED__ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED_FKEY); + return Arrays.asList(Keys.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED__ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED_FKEY); } private transient AdminStatistics _adminStatistics; + /** + * Get the implicit join path to the public.admin_statistics + * table. + */ public AdminStatistics adminStatistics() { if (_adminStatistics == null) _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED__ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED_FKEY); @@ -122,6 +140,11 @@ public AdminStatisticsPublishersByExtensionsPublished as(Name alias) { return new AdminStatisticsPublishersByExtensionsPublished(alias, this); } + @Override + public AdminStatisticsPublishersByExtensionsPublished as(Table alias) { + return new AdminStatisticsPublishersByExtensionsPublished(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -138,6 +161,14 @@ public AdminStatisticsPublishersByExtensionsPublished rename(Name name) { return new AdminStatisticsPublishersByExtensionsPublished(name, null); } + /** + * Rename this table + */ + @Override + public AdminStatisticsPublishersByExtensionsPublished rename(Table name) { + return new AdminStatisticsPublishersByExtensionsPublished(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row3 type methods // ------------------------------------------------------------------------- @@ -146,4 +177,19 @@ public AdminStatisticsPublishersByExtensionsPublished rename(Name name) { public Row3 fieldsRow() { return (Row3) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostActivePublishingUsers.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostActivePublishingUsers.java index 21dfd2c12..6c6d2d57f 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostActivePublishingUsers.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostActivePublishingUsers.java @@ -6,16 +6,20 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopMostActivePublishingUsersRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function3; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row3; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -33,7 +37,8 @@ public class AdminStatisticsTopMostActivePublishingUsers extends TableImplpublic.admin_statistics_top_most_active_publishing_users + * The reference instance of + * public.admin_statistics_top_most_active_publishing_users */ public static final AdminStatisticsTopMostActivePublishingUsers ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS = new AdminStatisticsTopMostActivePublishingUsers(); @@ -46,17 +51,20 @@ public Class getRecordType() } /** - * The column public.admin_statistics_top_most_active_publishing_users.admin_statistics_id. + * The column + * public.admin_statistics_top_most_active_publishing_users.admin_statistics_id. */ public final TableField ADMIN_STATISTICS_ID = createField(DSL.name("admin_statistics_id"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.admin_statistics_top_most_active_publishing_users.login_name. + * The column + * public.admin_statistics_top_most_active_publishing_users.login_name. */ public final TableField LOGIN_NAME = createField(DSL.name("login_name"), SQLDataType.VARCHAR(255).nullable(false), this, ""); /** - * The column public.admin_statistics_top_most_active_publishing_users.extension_version_count. + * The column + * public.admin_statistics_top_most_active_publishing_users.extension_version_count. */ public final TableField EXTENSION_VERSION_COUNT = createField(DSL.name("extension_version_count"), SQLDataType.INTEGER.nullable(false), this, ""); @@ -69,21 +77,27 @@ private AdminStatisticsTopMostActivePublishingUsers(Name alias, Tablepublic.admin_statistics_top_most_active_publishing_users table reference + * Create an aliased + * public.admin_statistics_top_most_active_publishing_users + * table reference */ public AdminStatisticsTopMostActivePublishingUsers(String alias) { this(DSL.name(alias), ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS); } /** - * Create an aliased public.admin_statistics_top_most_active_publishing_users table reference + * Create an aliased + * public.admin_statistics_top_most_active_publishing_users + * table reference */ public AdminStatisticsTopMostActivePublishingUsers(Name alias) { this(alias, ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS); } /** - * Create a public.admin_statistics_top_most_active_publishing_users table reference + * Create a + * public.admin_statistics_top_most_active_publishing_users + * table reference */ public AdminStatisticsTopMostActivePublishingUsers() { this(DSL.name("admin_statistics_top_most_active_publishing_users"), null); @@ -95,16 +109,20 @@ public AdminStatisticsTopMostActivePublishingUsers(Table c @Override public Schema getSchema() { - return Public.PUBLIC; + return aliased() ? null : Public.PUBLIC; } @Override public List> getReferences() { - return Arrays.>asList(Keys.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS__ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS_FKEY); + return Arrays.asList(Keys.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS__ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS_FKEY); } private transient AdminStatistics _adminStatistics; + /** + * Get the implicit join path to the public.admin_statistics + * table. + */ public AdminStatistics adminStatistics() { if (_adminStatistics == null) _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS__ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS_FKEY); @@ -122,6 +140,11 @@ public AdminStatisticsTopMostActivePublishingUsers as(Name alias) { return new AdminStatisticsTopMostActivePublishingUsers(alias, this); } + @Override + public AdminStatisticsTopMostActivePublishingUsers as(Table alias) { + return new AdminStatisticsTopMostActivePublishingUsers(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -138,6 +161,14 @@ public AdminStatisticsTopMostActivePublishingUsers rename(Name name) { return new AdminStatisticsTopMostActivePublishingUsers(name, null); } + /** + * Rename this table + */ + @Override + public AdminStatisticsTopMostActivePublishingUsers rename(Table name) { + return new AdminStatisticsTopMostActivePublishingUsers(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row3 type methods // ------------------------------------------------------------------------- @@ -146,4 +177,19 @@ public AdminStatisticsTopMostActivePublishingUsers rename(Name name) { public Row3 fieldsRow() { return (Row3) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostDownloadedExtensions.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostDownloadedExtensions.java index d90be33a0..d3f8151bd 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostDownloadedExtensions.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopMostDownloadedExtensions.java @@ -6,16 +6,20 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopMostDownloadedExtensionsRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function3; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row3; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -33,7 +37,8 @@ public class AdminStatisticsTopMostDownloadedExtensions extends TableImplpublic.admin_statistics_top_most_downloaded_extensions + * The reference instance of + * public.admin_statistics_top_most_downloaded_extensions */ public static final AdminStatisticsTopMostDownloadedExtensions ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS = new AdminStatisticsTopMostDownloadedExtensions(); @@ -46,17 +51,20 @@ public Class getRecordType() { } /** - * The column public.admin_statistics_top_most_downloaded_extensions.admin_statistics_id. + * The column + * public.admin_statistics_top_most_downloaded_extensions.admin_statistics_id. */ public final TableField ADMIN_STATISTICS_ID = createField(DSL.name("admin_statistics_id"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.admin_statistics_top_most_downloaded_extensions.extension_identifier. + * The column + * public.admin_statistics_top_most_downloaded_extensions.extension_identifier. */ public final TableField EXTENSION_IDENTIFIER = createField(DSL.name("extension_identifier"), SQLDataType.VARCHAR(255).nullable(false), this, ""); /** - * The column public.admin_statistics_top_most_downloaded_extensions.downloads. + * The column + * public.admin_statistics_top_most_downloaded_extensions.downloads. */ public final TableField DOWNLOADS = createField(DSL.name("downloads"), SQLDataType.BIGINT.nullable(false), this, ""); @@ -69,21 +77,27 @@ private AdminStatisticsTopMostDownloadedExtensions(Name alias, Tablepublic.admin_statistics_top_most_downloaded_extensions table reference + * Create an aliased + * public.admin_statistics_top_most_downloaded_extensions table + * reference */ public AdminStatisticsTopMostDownloadedExtensions(String alias) { this(DSL.name(alias), ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS); } /** - * Create an aliased public.admin_statistics_top_most_downloaded_extensions table reference + * Create an aliased + * public.admin_statistics_top_most_downloaded_extensions table + * reference */ public AdminStatisticsTopMostDownloadedExtensions(Name alias) { this(alias, ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS); } /** - * Create a public.admin_statistics_top_most_downloaded_extensions table reference + * Create a + * public.admin_statistics_top_most_downloaded_extensions table + * reference */ public AdminStatisticsTopMostDownloadedExtensions() { this(DSL.name("admin_statistics_top_most_downloaded_extensions"), null); @@ -95,16 +109,20 @@ public AdminStatisticsTopMostDownloadedExtensions(Table ch @Override public Schema getSchema() { - return Public.PUBLIC; + return aliased() ? null : Public.PUBLIC; } @Override public List> getReferences() { - return Arrays.>asList(Keys.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS__ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS_FKEY); + return Arrays.asList(Keys.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS__ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS_FKEY); } private transient AdminStatistics _adminStatistics; + /** + * Get the implicit join path to the public.admin_statistics + * table. + */ public AdminStatistics adminStatistics() { if (_adminStatistics == null) _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS__ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS_FKEY); @@ -122,6 +140,11 @@ public AdminStatisticsTopMostDownloadedExtensions as(Name alias) { return new AdminStatisticsTopMostDownloadedExtensions(alias, this); } + @Override + public AdminStatisticsTopMostDownloadedExtensions as(Table alias) { + return new AdminStatisticsTopMostDownloadedExtensions(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -138,6 +161,14 @@ public AdminStatisticsTopMostDownloadedExtensions rename(Name name) { return new AdminStatisticsTopMostDownloadedExtensions(name, null); } + /** + * Rename this table + */ + @Override + public AdminStatisticsTopMostDownloadedExtensions rename(Table name) { + return new AdminStatisticsTopMostDownloadedExtensions(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row3 type methods // ------------------------------------------------------------------------- @@ -146,4 +177,19 @@ public AdminStatisticsTopMostDownloadedExtensions rename(Name name) { public Row3 fieldsRow() { return (Row3) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensionVersions.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensionVersions.java index 222e90b57..f47d272dc 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensionVersions.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensionVersions.java @@ -6,16 +6,20 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopNamespaceExtensionVersionsRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function3; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row3; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -33,7 +37,8 @@ public class AdminStatisticsTopNamespaceExtensionVersions extends TableImplpublic.admin_statistics_top_namespace_extension_versions + * The reference instance of + * public.admin_statistics_top_namespace_extension_versions */ public static final AdminStatisticsTopNamespaceExtensionVersions ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS = new AdminStatisticsTopNamespaceExtensionVersions(); @@ -46,17 +51,20 @@ public Class getRecordType() } /** - * The column public.admin_statistics_top_namespace_extension_versions.admin_statistics_id. + * The column + * public.admin_statistics_top_namespace_extension_versions.admin_statistics_id. */ public final TableField ADMIN_STATISTICS_ID = createField(DSL.name("admin_statistics_id"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.admin_statistics_top_namespace_extension_versions.namespace. + * The column + * public.admin_statistics_top_namespace_extension_versions.namespace. */ public final TableField NAMESPACE = createField(DSL.name("namespace"), SQLDataType.VARCHAR(255).nullable(false), this, ""); /** - * The column public.admin_statistics_top_namespace_extension_versions.extension_version_count. + * The column + * public.admin_statistics_top_namespace_extension_versions.extension_version_count. */ public final TableField EXTENSION_VERSION_COUNT = createField(DSL.name("extension_version_count"), SQLDataType.INTEGER.nullable(false), this, ""); @@ -69,21 +77,27 @@ private AdminStatisticsTopNamespaceExtensionVersions(Name alias, Tablepublic.admin_statistics_top_namespace_extension_versions table reference + * Create an aliased + * public.admin_statistics_top_namespace_extension_versions + * table reference */ public AdminStatisticsTopNamespaceExtensionVersions(String alias) { this(DSL.name(alias), ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS); } /** - * Create an aliased public.admin_statistics_top_namespace_extension_versions table reference + * Create an aliased + * public.admin_statistics_top_namespace_extension_versions + * table reference */ public AdminStatisticsTopNamespaceExtensionVersions(Name alias) { this(alias, ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS); } /** - * Create a public.admin_statistics_top_namespace_extension_versions table reference + * Create a + * public.admin_statistics_top_namespace_extension_versions + * table reference */ public AdminStatisticsTopNamespaceExtensionVersions() { this(DSL.name("admin_statistics_top_namespace_extension_versions"), null); @@ -95,16 +109,20 @@ public AdminStatisticsTopNamespaceExtensionVersions(Table @Override public Schema getSchema() { - return Public.PUBLIC; + return aliased() ? null : Public.PUBLIC; } @Override public List> getReferences() { - return Arrays.>asList(Keys.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS_FKEY); + return Arrays.asList(Keys.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS_FKEY); } private transient AdminStatistics _adminStatistics; + /** + * Get the implicit join path to the public.admin_statistics + * table. + */ public AdminStatistics adminStatistics() { if (_adminStatistics == null) _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS_FKEY); @@ -122,6 +140,11 @@ public AdminStatisticsTopNamespaceExtensionVersions as(Name alias) { return new AdminStatisticsTopNamespaceExtensionVersions(alias, this); } + @Override + public AdminStatisticsTopNamespaceExtensionVersions as(Table alias) { + return new AdminStatisticsTopNamespaceExtensionVersions(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -138,6 +161,14 @@ public AdminStatisticsTopNamespaceExtensionVersions rename(Name name) { return new AdminStatisticsTopNamespaceExtensionVersions(name, null); } + /** + * Rename this table + */ + @Override + public AdminStatisticsTopNamespaceExtensionVersions rename(Table name) { + return new AdminStatisticsTopNamespaceExtensionVersions(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row3 type methods // ------------------------------------------------------------------------- @@ -146,4 +177,19 @@ public AdminStatisticsTopNamespaceExtensionVersions rename(Name name) { public Row3 fieldsRow() { return (Row3) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensions.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensions.java index ec13bd4ab..98d21abd3 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensions.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AdminStatisticsTopNamespaceExtensions.java @@ -6,16 +6,20 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.AdminStatisticsTopNamespaceExtensionsRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function3; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row3; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -33,7 +37,8 @@ public class AdminStatisticsTopNamespaceExtensions extends TableImplpublic.admin_statistics_top_namespace_extensions + * The reference instance of + * public.admin_statistics_top_namespace_extensions */ public static final AdminStatisticsTopNamespaceExtensions ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS = new AdminStatisticsTopNamespaceExtensions(); @@ -46,17 +51,20 @@ public Class getRecordType() { } /** - * The column public.admin_statistics_top_namespace_extensions.admin_statistics_id. + * The column + * public.admin_statistics_top_namespace_extensions.admin_statistics_id. */ public final TableField ADMIN_STATISTICS_ID = createField(DSL.name("admin_statistics_id"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.admin_statistics_top_namespace_extensions.namespace. + * The column + * public.admin_statistics_top_namespace_extensions.namespace. */ public final TableField NAMESPACE = createField(DSL.name("namespace"), SQLDataType.VARCHAR(255).nullable(false), this, ""); /** - * The column public.admin_statistics_top_namespace_extensions.extension_count. + * The column + * public.admin_statistics_top_namespace_extensions.extension_count. */ public final TableField EXTENSION_COUNT = createField(DSL.name("extension_count"), SQLDataType.INTEGER.nullable(false), this, ""); @@ -69,21 +77,26 @@ private AdminStatisticsTopNamespaceExtensions(Name alias, Tablepublic.admin_statistics_top_namespace_extensions table reference + * Create an aliased + * public.admin_statistics_top_namespace_extensions table + * reference */ public AdminStatisticsTopNamespaceExtensions(String alias) { this(DSL.name(alias), ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS); } /** - * Create an aliased public.admin_statistics_top_namespace_extensions table reference + * Create an aliased + * public.admin_statistics_top_namespace_extensions table + * reference */ public AdminStatisticsTopNamespaceExtensions(Name alias) { this(alias, ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS); } /** - * Create a public.admin_statistics_top_namespace_extensions table reference + * Create a public.admin_statistics_top_namespace_extensions + * table reference */ public AdminStatisticsTopNamespaceExtensions() { this(DSL.name("admin_statistics_top_namespace_extensions"), null); @@ -95,16 +108,20 @@ public AdminStatisticsTopNamespaceExtensions(Table child, @Override public Schema getSchema() { - return Public.PUBLIC; + return aliased() ? null : Public.PUBLIC; } @Override public List> getReferences() { - return Arrays.>asList(Keys.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS_FKEY); + return Arrays.asList(Keys.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS_FKEY); } private transient AdminStatistics _adminStatistics; + /** + * Get the implicit join path to the public.admin_statistics + * table. + */ public AdminStatistics adminStatistics() { if (_adminStatistics == null) _adminStatistics = new AdminStatistics(this, Keys.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS__ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS_FKEY); @@ -122,6 +139,11 @@ public AdminStatisticsTopNamespaceExtensions as(Name alias) { return new AdminStatisticsTopNamespaceExtensions(alias, this); } + @Override + public AdminStatisticsTopNamespaceExtensions as(Table alias) { + return new AdminStatisticsTopNamespaceExtensions(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -138,6 +160,14 @@ public AdminStatisticsTopNamespaceExtensions rename(Name name) { return new AdminStatisticsTopNamespaceExtensions(name, null); } + /** + * Rename this table + */ + @Override + public AdminStatisticsTopNamespaceExtensions rename(Table name) { + return new AdminStatisticsTopNamespaceExtensions(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row3 type methods // ------------------------------------------------------------------------- @@ -146,4 +176,19 @@ public AdminStatisticsTopNamespaceExtensions rename(Name name) { public Row3 fieldsRow() { return (Row3) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AzureDownloadCountProcessedItem.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AzureDownloadCountProcessedItem.java index ecc6aeffc..67749cbf9 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AzureDownloadCountProcessedItem.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/AzureDownloadCountProcessedItem.java @@ -5,18 +5,20 @@ import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.AzureDownloadCountProcessedItemRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function5; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row5; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -35,7 +37,8 @@ public class AzureDownloadCountProcessedItem extends TableImplpublic.azure_download_count_processed_item + * The reference instance of + * public.azure_download_count_processed_item */ public static final AzureDownloadCountProcessedItem AZURE_DOWNLOAD_COUNT_PROCESSED_ITEM = new AzureDownloadCountProcessedItem(); @@ -58,17 +61,20 @@ public Class getRecordType() { public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(255).nullable(false), this, ""); /** - * The column public.azure_download_count_processed_item.processed_on. + * The column + * public.azure_download_count_processed_item.processed_on. */ public final TableField PROCESSED_ON = createField(DSL.name("processed_on"), SQLDataType.LOCALDATETIME(6), this, ""); /** - * The column public.azure_download_count_processed_item.execution_time. + * The column + * public.azure_download_count_processed_item.execution_time. */ public final TableField EXECUTION_TIME = createField(DSL.name("execution_time"), SQLDataType.INTEGER, this, ""); /** - * The column public.azure_download_count_processed_item.success. + * The column + * public.azure_download_count_processed_item.success. */ public final TableField SUCCESS = createField(DSL.name("success"), SQLDataType.BOOLEAN.nullable(false), this, ""); @@ -81,21 +87,24 @@ private AzureDownloadCountProcessedItem(Name alias, Tablepublic.azure_download_count_processed_item table reference + * Create an aliased public.azure_download_count_processed_item + * table reference */ public AzureDownloadCountProcessedItem(String alias) { this(DSL.name(alias), AZURE_DOWNLOAD_COUNT_PROCESSED_ITEM); } /** - * Create an aliased public.azure_download_count_processed_item table reference + * Create an aliased public.azure_download_count_processed_item + * table reference */ public AzureDownloadCountProcessedItem(Name alias) { this(alias, AZURE_DOWNLOAD_COUNT_PROCESSED_ITEM); } /** - * Create a public.azure_download_count_processed_item table reference + * Create a public.azure_download_count_processed_item table + * reference */ public AzureDownloadCountProcessedItem() { this(DSL.name("azure_download_count_processed_item"), null); @@ -107,7 +116,7 @@ public AzureDownloadCountProcessedItem(Table child, Foreig @Override public Schema getSchema() { - return Public.PUBLIC; + return aliased() ? null : Public.PUBLIC; } @Override @@ -115,11 +124,6 @@ public UniqueKey getPrimaryKey() { return Keys.AZURE_DOWNLOAD_COUNT_PROCESSED_ITEM_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.AZURE_DOWNLOAD_COUNT_PROCESSED_ITEM_PKEY); - } - @Override public AzureDownloadCountProcessedItem as(String alias) { return new AzureDownloadCountProcessedItem(DSL.name(alias), this); @@ -130,6 +134,11 @@ public AzureDownloadCountProcessedItem as(Name alias) { return new AzureDownloadCountProcessedItem(alias, this); } + @Override + public AzureDownloadCountProcessedItem as(Table alias) { + return new AzureDownloadCountProcessedItem(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -146,6 +155,14 @@ public AzureDownloadCountProcessedItem rename(Name name) { return new AzureDownloadCountProcessedItem(name, null); } + /** + * Rename this table + */ + @Override + public AzureDownloadCountProcessedItem rename(Table name) { + return new AzureDownloadCountProcessedItem(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row5 type methods // ------------------------------------------------------------------------- @@ -154,4 +171,19 @@ public AzureDownloadCountProcessedItem rename(Name name) { public Row5 fieldsRow() { return (Row5) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function5 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function5 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Download.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Download.java index 55b29733e..87182bf10 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Download.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Download.java @@ -7,6 +7,7 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; @@ -14,11 +15,14 @@ import org.eclipse.openvsx.jooq.tables.records.DownloadRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function4; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row4; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -104,12 +108,12 @@ public Download(Table child, ForeignKey @Override public Schema getSchema() { - return Public.PUBLIC; + return aliased() ? null : Public.PUBLIC; } @Override public List getIndexes() { - return Arrays.asList(Indexes.DOWNLOAD_TIMESTAMP_BRIN_IDX); + return Arrays.asList(Indexes.DOWNLOAD_TIMESTAMP_BRIN_IDX); } @Override @@ -117,11 +121,6 @@ public UniqueKey getPrimaryKey() { return Keys.DOWNLOAD_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.DOWNLOAD_PKEY); - } - @Override public Download as(String alias) { return new Download(DSL.name(alias), this); @@ -132,6 +131,11 @@ public Download as(Name alias) { return new Download(alias, this); } + @Override + public Download as(Table alias) { + return new Download(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -148,6 +152,14 @@ public Download rename(Name name) { return new Download(name, null); } + /** + * Rename this table + */ + @Override + public Download rename(Table name) { + return new Download(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row4 type methods // ------------------------------------------------------------------------- @@ -156,4 +168,19 @@ public Download rename(Name name) { public Row4 fieldsRow() { return (Row4) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/EntityActiveState.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/EntityActiveState.java index e80bdb8af..8c98f7627 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/EntityActiveState.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/EntityActiveState.java @@ -5,18 +5,20 @@ import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.EntityActiveStateRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function5; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row5; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -107,7 +109,7 @@ public EntityActiveState(Table child, ForeignKey getPrimaryKey() { return Keys.ENTITY_ACTIVE_STATE_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.ENTITY_ACTIVE_STATE_PKEY); - } - @Override public EntityActiveState as(String alias) { return new EntityActiveState(DSL.name(alias), this); @@ -130,6 +127,11 @@ public EntityActiveState as(Name alias) { return new EntityActiveState(alias, this); } + @Override + public EntityActiveState as(Table alias) { + return new EntityActiveState(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -146,6 +148,14 @@ public EntityActiveState rename(Name name) { return new EntityActiveState(name, null); } + /** + * Rename this table + */ + @Override + public EntityActiveState rename(Table name) { + return new EntityActiveState(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row5 type methods // ------------------------------------------------------------------------- @@ -154,4 +164,19 @@ public EntityActiveState rename(Name name) { public Row5 fieldsRow() { return (Row5) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function5 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function5 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Extension.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Extension.java index a38fd46b2..059b31ec2 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Extension.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Extension.java @@ -7,6 +7,7 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; @@ -14,11 +15,14 @@ import org.eclipse.openvsx.jooq.tables.records.ExtensionRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function10; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row10; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -134,12 +138,12 @@ public Extension(Table child, ForeignKey getIndexes() { - return Arrays.asList(Indexes.EXTENSION__NAMESPACE_ID__IDX); + return Arrays.asList(Indexes.EXTENSION__NAMESPACE_ID__IDX); } @Override @@ -148,17 +152,20 @@ public UniqueKey getPrimaryKey() { } @Override - public List> getKeys() { - return Arrays.>asList(Keys.EXTENSION_PKEY, Keys.UNIQUE_EXTENSION_PUBLIC_ID); + public List> getUniqueKeys() { + return Arrays.asList(Keys.UNIQUE_EXTENSION_PUBLIC_ID); } @Override public List> getReferences() { - return Arrays.>asList(Keys.EXTENSION__FK64IMD3NRJ67D50TPKJS94NGMN); + return Arrays.asList(Keys.EXTENSION__FK64IMD3NRJ67D50TPKJS94NGMN); } private transient Namespace _namespace; + /** + * Get the implicit join path to the public.namespace table. + */ public Namespace namespace() { if (_namespace == null) _namespace = new Namespace(this, Keys.EXTENSION__FK64IMD3NRJ67D50TPKJS94NGMN); @@ -176,6 +183,11 @@ public Extension as(Name alias) { return new Extension(alias, this); } + @Override + public Extension as(Table alias) { + return new Extension(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -192,6 +204,14 @@ public Extension rename(Name name) { return new Extension(name, null); } + /** + * Rename this table + */ + @Override + public Extension rename(Table name) { + return new Extension(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row10 type methods // ------------------------------------------------------------------------- @@ -200,4 +220,19 @@ public Extension rename(Name name) { public Row10 fieldsRow() { return (Row10) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function10 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function10 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionReview.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionReview.java index b2d4304a8..7aaafabd9 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionReview.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionReview.java @@ -7,6 +7,7 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; @@ -14,11 +15,14 @@ import org.eclipse.openvsx.jooq.tables.records.ExtensionReviewRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function8; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row8; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -124,12 +128,12 @@ public ExtensionReview(Table child, ForeignKey getIndexes() { - return Arrays.asList(Indexes.EXTENSION_REVIEW__EXTENSION_ID__IDX, Indexes.EXTENSION_REVIEW__USER_ID__IDX); + return Arrays.asList(Indexes.EXTENSION_REVIEW__EXTENSION_ID__IDX, Indexes.EXTENSION_REVIEW__USER_ID__IDX); } @Override @@ -137,19 +141,17 @@ public UniqueKey getPrimaryKey() { return Keys.EXTENSION_REVIEW_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.EXTENSION_REVIEW_PKEY); - } - @Override public List> getReferences() { - return Arrays.>asList(Keys.EXTENSION_REVIEW__FKGD2DQDC23OGBNOBX8AFJFPNKP, Keys.EXTENSION_REVIEW__FKINJBN9GRK135Y6IK0UT4UJP0W); + return Arrays.asList(Keys.EXTENSION_REVIEW__FKGD2DQDC23OGBNOBX8AFJFPNKP, Keys.EXTENSION_REVIEW__FKINJBN9GRK135Y6IK0UT4UJP0W); } private transient Extension _extension; private transient UserData _userData; + /** + * Get the implicit join path to the public.extension table. + */ public Extension extension() { if (_extension == null) _extension = new Extension(this, Keys.EXTENSION_REVIEW__FKGD2DQDC23OGBNOBX8AFJFPNKP); @@ -157,6 +159,9 @@ public Extension extension() { return _extension; } + /** + * Get the implicit join path to the public.user_data table. + */ public UserData userData() { if (_userData == null) _userData = new UserData(this, Keys.EXTENSION_REVIEW__FKINJBN9GRK135Y6IK0UT4UJP0W); @@ -174,6 +179,11 @@ public ExtensionReview as(Name alias) { return new ExtensionReview(alias, this); } + @Override + public ExtensionReview as(Table alias) { + return new ExtensionReview(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -190,6 +200,14 @@ public ExtensionReview rename(Name name) { return new ExtensionReview(name, null); } + /** + * Rename this table + */ + @Override + public ExtensionReview rename(Table name) { + return new ExtensionReview(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row8 type methods // ------------------------------------------------------------------------- @@ -198,4 +216,19 @@ public ExtensionReview rename(Name name) { public Row8 fieldsRow() { return (Row8) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function8 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function8 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionVersion.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionVersion.java index 512907d94..4a57c0fb3 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionVersion.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/ExtensionVersion.java @@ -219,7 +219,8 @@ public Class getRecordType() { public final TableField SEMVER_BUILD_METADATA = createField(DSL.name("semver_build_metadata"), SQLDataType.VARCHAR, this, ""); /** - * The column public.extension_version.universal_target_platform. + * The column + * public.extension_version.universal_target_platform. */ public final TableField UNIVERSAL_TARGET_PLATFORM = createField(DSL.name("universal_target_platform"), SQLDataType.BOOLEAN, this, ""); @@ -258,12 +259,12 @@ public ExtensionVersion(Table child, ForeignKey getIndexes() { - return Arrays.asList(Indexes.EXTENSION_VERSION__EXTENSION_ID__IDX, Indexes.EXTENSION_VERSION__PUBLISHED_WITH_ID__IDX, Indexes.EXTENSION_VERSION_BY_TARGET_PLATFORM_ORDER_BY_IDX, Indexes.EXTENSION_VERSION_LATEST_ORDER_BY_IDX, Indexes.EXTENSION_VERSION_ORDER_BY_IDX, Indexes.EXTENSION_VERSION_VERSION_LIST_ORDER_BY_IDX, Indexes.EXTENSION_VERSION_VERSION_MAP_ORDER_BY_IDX); + return Arrays.asList(Indexes.EXTENSION_VERSION__EXTENSION_ID__IDX, Indexes.EXTENSION_VERSION__PUBLISHED_WITH_ID__IDX, Indexes.EXTENSION_VERSION_BY_TARGET_PLATFORM_ORDER_BY_IDX, Indexes.EXTENSION_VERSION_LATEST_ORDER_BY_IDX, Indexes.EXTENSION_VERSION_ORDER_BY_IDX, Indexes.EXTENSION_VERSION_VERSION_LIST_ORDER_BY_IDX, Indexes.EXTENSION_VERSION_VERSION_MAP_ORDER_BY_IDX); } @Override @@ -272,19 +273,22 @@ public UniqueKey getPrimaryKey() { } @Override - public List> getKeys() { - return Arrays.>asList(Keys.EXTENSION_VERSION_PKEY, Keys.UNIQUE_EXTENSION_VERSION); + public List> getUniqueKeys() { + return Arrays.asList(Keys.UNIQUE_EXTENSION_VERSION); } @Override public List> getReferences() { - return Arrays.>asList(Keys.EXTENSION_VERSION__FKKHS1EC9S9J08FGICQ9PMWU6BT, Keys.EXTENSION_VERSION__FK70KHJ8PM0VACASUIIAQ0W0R80, Keys.EXTENSION_VERSION__EXTENSION_VERSION_SIGNATURE_KEY_PAIR_FKEY); + return Arrays.asList(Keys.EXTENSION_VERSION__FKKHS1EC9S9J08FGICQ9PMWU6BT, Keys.EXTENSION_VERSION__FK70KHJ8PM0VACASUIIAQ0W0R80, Keys.EXTENSION_VERSION__EXTENSION_VERSION_SIGNATURE_KEY_PAIR_FKEY); } private transient Extension _extension; private transient PersonalAccessToken _personalAccessToken; private transient SignatureKeyPair _signatureKeyPair; + /** + * Get the implicit join path to the public.extension table. + */ public Extension extension() { if (_extension == null) _extension = new Extension(this, Keys.EXTENSION_VERSION__FKKHS1EC9S9J08FGICQ9PMWU6BT); @@ -292,6 +296,10 @@ public Extension extension() { return _extension; } + /** + * Get the implicit join path to the + * public.personal_access_token table. + */ public PersonalAccessToken personalAccessToken() { if (_personalAccessToken == null) _personalAccessToken = new PersonalAccessToken(this, Keys.EXTENSION_VERSION__FK70KHJ8PM0VACASUIIAQ0W0R80); @@ -299,6 +307,10 @@ public PersonalAccessToken personalAccessToken() { return _personalAccessToken; } + /** + * Get the implicit join path to the public.signature_key_pair + * table. + */ public SignatureKeyPair signatureKeyPair() { if (_signatureKeyPair == null) _signatureKeyPair = new SignatureKeyPair(this, Keys.EXTENSION_VERSION__EXTENSION_VERSION_SIGNATURE_KEY_PAIR_FKEY); @@ -316,6 +328,11 @@ public ExtensionVersion as(Name alias) { return new ExtensionVersion(alias, this); } + @Override + public ExtensionVersion as(Table alias) { + return new ExtensionVersion(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -331,4 +348,12 @@ public ExtensionVersion rename(String name) { public ExtensionVersion rename(Name name) { return new ExtensionVersion(name, null); } + + /** + * Rename this table + */ + @Override + public ExtensionVersion rename(Table name) { + return new ExtensionVersion(name.getQualifiedName(), null); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FileResource.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FileResource.java index 9b046f7a4..e12e401e6 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FileResource.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FileResource.java @@ -6,6 +6,7 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; @@ -13,11 +14,14 @@ import org.eclipse.openvsx.jooq.tables.records.FileResourceRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function7; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row6; +import org.jooq.Records; +import org.jooq.Row7; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -78,6 +82,11 @@ public Class getRecordType() { */ public final TableField STORAGE_TYPE = createField(DSL.name("storage_type"), SQLDataType.VARCHAR(32), this, ""); + /** + * The column public.file_resource.content_type. + */ + public final TableField CONTENT_TYPE = createField(DSL.name("content_type"), SQLDataType.VARCHAR(255), this, ""); + private FileResource(Name alias, Table aliased) { this(alias, aliased, null); } @@ -113,12 +122,12 @@ public FileResource(Table child, ForeignKey getIndexes() { - return Arrays.asList(Indexes.FILE_RESOURCE_EXTENSION_IDX, Indexes.FILE_RESOURCE_TYPE_IDX); + return Arrays.asList(Indexes.FILE_RESOURCE_EXTENSION_IDX, Indexes.FILE_RESOURCE_TYPE_IDX); } @Override @@ -126,18 +135,17 @@ public UniqueKey getPrimaryKey() { return Keys.FILE_RESOURCE_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.FILE_RESOURCE_PKEY); - } - @Override public List> getReferences() { - return Arrays.>asList(Keys.FILE_RESOURCE__FILE_RESOURCE_EXTENSION_FKEY); + return Arrays.asList(Keys.FILE_RESOURCE__FILE_RESOURCE_EXTENSION_FKEY); } private transient ExtensionVersion _extensionVersion; + /** + * Get the implicit join path to the public.extension_version + * table. + */ public ExtensionVersion extensionVersion() { if (_extensionVersion == null) _extensionVersion = new ExtensionVersion(this, Keys.FILE_RESOURCE__FILE_RESOURCE_EXTENSION_FKEY); @@ -155,6 +163,11 @@ public FileResource as(Name alias) { return new FileResource(alias, this); } + @Override + public FileResource as(Table alias) { + return new FileResource(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -171,12 +184,35 @@ public FileResource rename(Name name) { return new FileResource(name, null); } + /** + * Rename this table + */ + @Override + public FileResource rename(Table name) { + return new FileResource(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- - // Row6 type methods + // Row7 type methods // ------------------------------------------------------------------------- @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function7 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function7 from) { + return convertFrom(toType, Records.mapping(from)); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FlywaySchemaHistory.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FlywaySchemaHistory.java index ece3fa018..1ec65c0c1 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FlywaySchemaHistory.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/FlywaySchemaHistory.java @@ -7,6 +7,7 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; @@ -14,11 +15,14 @@ import org.eclipse.openvsx.jooq.tables.records.FlywaySchemaHistoryRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function10; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row10; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -87,7 +91,7 @@ public Class getRecordType() { /** * The column public.flyway_schema_history.installed_on. */ - public final TableField INSTALLED_ON = createField(DSL.name("installed_on"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field("now()", SQLDataType.LOCALDATETIME)), this, ""); + public final TableField INSTALLED_ON = createField(DSL.name("installed_on"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); /** * The column public.flyway_schema_history.execution_time. @@ -108,14 +112,16 @@ private FlywaySchemaHistory(Name alias, Table aliased } /** - * Create an aliased public.flyway_schema_history table reference + * Create an aliased public.flyway_schema_history table + * reference */ public FlywaySchemaHistory(String alias) { this(DSL.name(alias), FLYWAY_SCHEMA_HISTORY); } /** - * Create an aliased public.flyway_schema_history table reference + * Create an aliased public.flyway_schema_history table + * reference */ public FlywaySchemaHistory(Name alias) { this(alias, FLYWAY_SCHEMA_HISTORY); @@ -134,12 +140,12 @@ public FlywaySchemaHistory(Table child, ForeignKey getIndexes() { - return Arrays.asList(Indexes.FLYWAY_SCHEMA_HISTORY_S_IDX); + return Arrays.asList(Indexes.FLYWAY_SCHEMA_HISTORY_S_IDX); } @Override @@ -147,11 +153,6 @@ public UniqueKey getPrimaryKey() { return Keys.FLYWAY_SCHEMA_HISTORY_PK; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.FLYWAY_SCHEMA_HISTORY_PK); - } - @Override public FlywaySchemaHistory as(String alias) { return new FlywaySchemaHistory(DSL.name(alias), this); @@ -162,6 +163,11 @@ public FlywaySchemaHistory as(Name alias) { return new FlywaySchemaHistory(alias, this); } + @Override + public FlywaySchemaHistory as(Table alias) { + return new FlywaySchemaHistory(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -178,6 +184,14 @@ public FlywaySchemaHistory rename(Name name) { return new FlywaySchemaHistory(name, null); } + /** + * Rename this table + */ + @Override + public FlywaySchemaHistory rename(Table name) { + return new FlywaySchemaHistory(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row10 type methods // ------------------------------------------------------------------------- @@ -186,4 +200,19 @@ public FlywaySchemaHistory rename(Name name) { public Row10 fieldsRow() { return (Row10) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function10 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function10 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrBackgroundjobservers.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrBackgroundjobservers.java index da060d814..0ccbcee2f 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrBackgroundjobservers.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrBackgroundjobservers.java @@ -8,6 +8,7 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; @@ -15,11 +16,14 @@ import org.eclipse.openvsx.jooq.tables.records.JobrunrBackgroundjobserversRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function16; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row15; +import org.jooq.Records; +import org.jooq.Row16; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -38,7 +42,8 @@ public class JobrunrBackgroundjobservers extends TableImplpublic.jobrunr_backgroundjobservers + * The reference instance of + * public.jobrunr_backgroundjobservers */ public static final JobrunrBackgroundjobservers JOBRUNR_BACKGROUNDJOBSERVERS = new JobrunrBackgroundjobservers(); @@ -56,22 +61,26 @@ public Class getRecordType() { public final TableField ID = createField(DSL.name("id"), SQLDataType.CHAR(36).nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.workerpoolsize. + * The column + * public.jobrunr_backgroundjobservers.workerpoolsize. */ public final TableField WORKERPOOLSIZE = createField(DSL.name("workerpoolsize"), SQLDataType.INTEGER.nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.pollintervalinseconds. + * The column + * public.jobrunr_backgroundjobservers.pollintervalinseconds. */ public final TableField POLLINTERVALINSECONDS = createField(DSL.name("pollintervalinseconds"), SQLDataType.INTEGER.nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.firstheartbeat. + * The column + * public.jobrunr_backgroundjobservers.firstheartbeat. */ public final TableField FIRSTHEARTBEAT = createField(DSL.name("firstheartbeat"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.lastheartbeat. + * The column + * public.jobrunr_backgroundjobservers.lastheartbeat. */ public final TableField LASTHEARTBEAT = createField(DSL.name("lastheartbeat"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); @@ -81,50 +90,64 @@ public Class getRecordType() { public final TableField RUNNING = createField(DSL.name("running"), SQLDataType.INTEGER.nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.systemtotalmemory. + * The column + * public.jobrunr_backgroundjobservers.systemtotalmemory. */ public final TableField SYSTEMTOTALMEMORY = createField(DSL.name("systemtotalmemory"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.systemfreememory. + * The column + * public.jobrunr_backgroundjobservers.systemfreememory. */ public final TableField SYSTEMFREEMEMORY = createField(DSL.name("systemfreememory"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.systemcpuload. + * The column + * public.jobrunr_backgroundjobservers.systemcpuload. */ public final TableField SYSTEMCPULOAD = createField(DSL.name("systemcpuload"), SQLDataType.NUMERIC(3, 2).nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.processmaxmemory. + * The column + * public.jobrunr_backgroundjobservers.processmaxmemory. */ public final TableField PROCESSMAXMEMORY = createField(DSL.name("processmaxmemory"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.processfreememory. + * The column + * public.jobrunr_backgroundjobservers.processfreememory. */ public final TableField PROCESSFREEMEMORY = createField(DSL.name("processfreememory"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.processallocatedmemory. + * The column + * public.jobrunr_backgroundjobservers.processallocatedmemory. */ public final TableField PROCESSALLOCATEDMEMORY = createField(DSL.name("processallocatedmemory"), SQLDataType.BIGINT.nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.processcpuload. + * The column + * public.jobrunr_backgroundjobservers.processcpuload. */ public final TableField PROCESSCPULOAD = createField(DSL.name("processcpuload"), SQLDataType.NUMERIC(3, 2).nullable(false), this, ""); /** - * The column public.jobrunr_backgroundjobservers.deletesucceededjobsafter. + * The column + * public.jobrunr_backgroundjobservers.deletesucceededjobsafter. */ public final TableField DELETESUCCEEDEDJOBSAFTER = createField(DSL.name("deletesucceededjobsafter"), SQLDataType.VARCHAR(32), this, ""); /** - * The column public.jobrunr_backgroundjobservers.permanentlydeletejobsafter. + * The column + * public.jobrunr_backgroundjobservers.permanentlydeletejobsafter. */ public final TableField PERMANENTLYDELETEJOBSAFTER = createField(DSL.name("permanentlydeletejobsafter"), SQLDataType.VARCHAR(32), this, ""); + /** + * The column public.jobrunr_backgroundjobservers.name. + */ + public final TableField NAME = createField(DSL.name("name"), SQLDataType.VARCHAR(128), this, ""); + private JobrunrBackgroundjobservers(Name alias, Table aliased) { this(alias, aliased, null); } @@ -134,14 +157,16 @@ private JobrunrBackgroundjobservers(Name alias, Tablepublic.jobrunr_backgroundjobservers table reference + * Create an aliased public.jobrunr_backgroundjobservers table + * reference */ public JobrunrBackgroundjobservers(String alias) { this(DSL.name(alias), JOBRUNR_BACKGROUNDJOBSERVERS); } /** - * Create an aliased public.jobrunr_backgroundjobservers table reference + * Create an aliased public.jobrunr_backgroundjobservers table + * reference */ public JobrunrBackgroundjobservers(Name alias) { this(alias, JOBRUNR_BACKGROUNDJOBSERVERS); @@ -160,12 +185,12 @@ public JobrunrBackgroundjobservers(Table child, ForeignKey @Override public Schema getSchema() { - return Public.PUBLIC; + return aliased() ? null : Public.PUBLIC; } @Override public List getIndexes() { - return Arrays.asList(Indexes.JOBRUNR_BGJOBSRVRS_FSTHB_IDX, Indexes.JOBRUNR_BGJOBSRVRS_LSTHB_IDX); + return Arrays.asList(Indexes.JOBRUNR_BGJOBSRVRS_FSTHB_IDX, Indexes.JOBRUNR_BGJOBSRVRS_LSTHB_IDX); } @Override @@ -173,11 +198,6 @@ public UniqueKey getPrimaryKey() { return Keys.JOBRUNR_BACKGROUNDJOBSERVERS_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.JOBRUNR_BACKGROUNDJOBSERVERS_PKEY); - } - @Override public JobrunrBackgroundjobservers as(String alias) { return new JobrunrBackgroundjobservers(DSL.name(alias), this); @@ -188,6 +208,11 @@ public JobrunrBackgroundjobservers as(Name alias) { return new JobrunrBackgroundjobservers(alias, this); } + @Override + public JobrunrBackgroundjobservers as(Table alias) { + return new JobrunrBackgroundjobservers(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -204,12 +229,35 @@ public JobrunrBackgroundjobservers rename(Name name) { return new JobrunrBackgroundjobservers(name, null); } + /** + * Rename this table + */ + @Override + public JobrunrBackgroundjobservers rename(Table name) { + return new JobrunrBackgroundjobservers(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- - // Row15 type methods + // Row16 type methods // ------------------------------------------------------------------------- @Override - public Row15 fieldsRow() { - return (Row15) super.fieldsRow(); + public Row16 fieldsRow() { + return (Row16) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function16 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function16 from) { + return convertFrom(toType, Records.mapping(from)); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobs.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobs.java index 058b41270..e5950fa75 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobs.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobs.java @@ -7,6 +7,7 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; @@ -14,11 +15,14 @@ import org.eclipse.openvsx.jooq.tables.records.JobrunrJobsRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function9; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row9; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -129,12 +133,12 @@ public JobrunrJobs(Table child, ForeignKey getIndexes() { - return Arrays.asList(Indexes.JOBRUNR_JOB_CREATED_AT_IDX, Indexes.JOBRUNR_JOB_RCI_IDX, Indexes.JOBRUNR_JOB_SCHEDULED_AT_IDX, Indexes.JOBRUNR_JOB_SIGNATURE_IDX, Indexes.JOBRUNR_JOB_UPDATED_AT_IDX, Indexes.JOBRUNR_STATE_IDX); + return Arrays.asList(Indexes.JOBRUNR_JOB_CREATED_AT_IDX, Indexes.JOBRUNR_JOB_RCI_IDX, Indexes.JOBRUNR_JOB_SCHEDULED_AT_IDX, Indexes.JOBRUNR_JOB_SIGNATURE_IDX, Indexes.JOBRUNR_JOBS_STATE_UPDATED_IDX, Indexes.JOBRUNR_STATE_IDX); } @Override @@ -142,11 +146,6 @@ public UniqueKey getPrimaryKey() { return Keys.JOBRUNR_JOBS_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.JOBRUNR_JOBS_PKEY); - } - @Override public JobrunrJobs as(String alias) { return new JobrunrJobs(DSL.name(alias), this); @@ -157,6 +156,11 @@ public JobrunrJobs as(Name alias) { return new JobrunrJobs(alias, this); } + @Override + public JobrunrJobs as(Table alias) { + return new JobrunrJobs(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -173,6 +177,14 @@ public JobrunrJobs rename(Name name) { return new JobrunrJobs(name, null); } + /** + * Rename this table + */ + @Override + public JobrunrJobs rename(Table name) { + return new JobrunrJobs(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row9 type methods // ------------------------------------------------------------------------- @@ -181,4 +193,19 @@ public JobrunrJobs rename(Name name) { public Row9 fieldsRow() { return (Row9) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function9 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function9 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobsStats.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobsStats.java index fa6c85e0b..47b0387ec 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobsStats.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrJobsStats.java @@ -4,14 +4,20 @@ package org.eclipse.openvsx.jooq.tables; +import java.math.BigDecimal; +import java.util.function.Function; + import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.JobrunrJobsStatsRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function10; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row11; +import org.jooq.Records; +import org.jooq.Row10; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -46,11 +52,6 @@ public Class getRecordType() { */ public final TableField TOTAL = createField(DSL.name("total"), SQLDataType.BIGINT, this, ""); - /** - * The column public.jobrunr_jobs_stats.awaiting. - */ - public final TableField AWAITING = createField(DSL.name("awaiting"), SQLDataType.BIGINT, this, ""); - /** * The column public.jobrunr_jobs_stats.scheduled. */ @@ -79,7 +80,7 @@ public Class getRecordType() { /** * The column public.jobrunr_jobs_stats.alltimesucceeded. */ - public final TableField ALLTIMESUCCEEDED = createField(DSL.name("alltimesucceeded"), SQLDataType.BIGINT, this, ""); + public final TableField ALLTIMESUCCEEDED = createField(DSL.name("alltimesucceeded"), SQLDataType.NUMERIC, this, ""); /** * The column public.jobrunr_jobs_stats.deleted. @@ -87,7 +88,8 @@ public Class getRecordType() { public final TableField DELETED = createField(DSL.name("deleted"), SQLDataType.BIGINT, this, ""); /** - * The column public.jobrunr_jobs_stats.nbrofbackgroundjobservers. + * The column + * public.jobrunr_jobs_stats.nbrofbackgroundjobservers. */ public final TableField NBROFBACKGROUNDJOBSERVERS = createField(DSL.name("nbrofbackgroundjobservers"), SQLDataType.BIGINT, this, ""); @@ -101,7 +103,42 @@ private JobrunrJobsStats(Name alias, Table aliased) { } private JobrunrJobsStats(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("create view \"jobrunr_jobs_stats\" as SELECT count(*) AS total,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'AWAITING'::text)) AS awaiting,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'SCHEDULED'::text)) AS scheduled,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'ENQUEUED'::text)) AS enqueued,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'PROCESSING'::text)) AS processing,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'FAILED'::text)) AS failed,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'SUCCEEDED'::text)) AS succeeded,\n ( SELECT ((jm.value)::character(10))::numeric(10,0) AS value\n FROM jobrunr_metadata jm\n WHERE ((jm.id)::text = 'succeeded-jobs-counter-cluster'::text)) AS alltimesucceeded,\n ( SELECT count(*) AS count\n FROM jobrunr_jobs jobs\n WHERE ((jobs.state)::text = 'DELETED'::text)) AS deleted,\n ( SELECT count(*) AS count\n FROM jobrunr_backgroundjobservers) AS nbrofbackgroundjobservers,\n ( SELECT count(*) AS count\n FROM jobrunr_recurring_jobs) AS nbrofrecurringjobs\n FROM jobrunr_jobs j;")); + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" + create view "jobrunr_jobs_stats" as WITH job_stat_results AS ( + SELECT jobrunr_jobs.state, + count(*) AS count + FROM jobrunr_jobs + GROUP BY ROLLUP(jobrunr_jobs.state) + ) + SELECT COALESCE(( SELECT job_stat_results.count + FROM job_stat_results + WHERE (job_stat_results.state IS NULL)), (0)::bigint) AS total, + COALESCE(( SELECT job_stat_results.count + FROM job_stat_results + WHERE ((job_stat_results.state)::text = 'SCHEDULED'::text)), (0)::bigint) AS scheduled, + COALESCE(( SELECT job_stat_results.count + FROM job_stat_results + WHERE ((job_stat_results.state)::text = 'ENQUEUED'::text)), (0)::bigint) AS enqueued, + COALESCE(( SELECT job_stat_results.count + FROM job_stat_results + WHERE ((job_stat_results.state)::text = 'PROCESSING'::text)), (0)::bigint) AS processing, + COALESCE(( SELECT job_stat_results.count + FROM job_stat_results + WHERE ((job_stat_results.state)::text = 'FAILED'::text)), (0)::bigint) AS failed, + COALESCE(( SELECT job_stat_results.count + FROM job_stat_results + WHERE ((job_stat_results.state)::text = 'SUCCEEDED'::text)), (0)::bigint) AS succeeded, + COALESCE(( SELECT ((jm.value)::character(10))::numeric(10,0) AS value + FROM jobrunr_metadata jm + WHERE ((jm.id)::text = 'succeeded-jobs-counter-cluster'::text)), (0)::numeric) AS alltimesucceeded, + COALESCE(( SELECT job_stat_results.count + FROM job_stat_results + WHERE ((job_stat_results.state)::text = 'DELETED'::text)), (0)::bigint) AS deleted, + ( SELECT count(*) AS count + FROM jobrunr_backgroundjobservers) AS nbrofbackgroundjobservers, + ( SELECT count(*) AS count + FROM jobrunr_recurring_jobs) AS nbrofrecurringjobs; + """)); } /** @@ -131,7 +168,7 @@ public JobrunrJobsStats(Table child, ForeignKey alias) { + return new JobrunrJobsStats(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -160,12 +202,35 @@ public JobrunrJobsStats rename(Name name) { return new JobrunrJobsStats(name, null); } + /** + * Rename this table + */ + @Override + public JobrunrJobsStats rename(Table name) { + return new JobrunrJobsStats(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- - // Row11 type methods + // Row10 type methods // ------------------------------------------------------------------------- @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function10 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function10 from) { + return convertFrom(toType, Records.mapping(from)); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMetadata.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMetadata.java index 71f325d35..cd01f7c2d 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMetadata.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMetadata.java @@ -5,18 +5,20 @@ import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.JobrunrMetadataRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function6; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row6; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -112,7 +114,7 @@ public JobrunrMetadata(Table child, ForeignKey getPrimaryKey() { return Keys.JOBRUNR_METADATA_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.JOBRUNR_METADATA_PKEY); - } - @Override public JobrunrMetadata as(String alias) { return new JobrunrMetadata(DSL.name(alias), this); @@ -135,6 +132,11 @@ public JobrunrMetadata as(Name alias) { return new JobrunrMetadata(alias, this); } + @Override + public JobrunrMetadata as(Table alias) { + return new JobrunrMetadata(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -151,6 +153,14 @@ public JobrunrMetadata rename(Name name) { return new JobrunrMetadata(name, null); } + /** + * Rename this table + */ + @Override + public JobrunrMetadata rename(Table name) { + return new JobrunrMetadata(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row6 type methods // ------------------------------------------------------------------------- @@ -159,4 +169,19 @@ public JobrunrMetadata rename(Name name) { public Row6 fieldsRow() { return (Row6) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function6 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function6 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMigrations.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMigrations.java index ca0fcee43..46c91088d 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMigrations.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrMigrations.java @@ -4,18 +4,20 @@ package org.eclipse.openvsx.jooq.tables; -import java.util.Arrays; -import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.JobrunrMigrationsRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function3; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row3; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -96,7 +98,7 @@ public JobrunrMigrations(Table child, ForeignKey getPrimaryKey() { return Keys.JOBRUNR_MIGRATIONS_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.JOBRUNR_MIGRATIONS_PKEY); - } - @Override public JobrunrMigrations as(String alias) { return new JobrunrMigrations(DSL.name(alias), this); @@ -119,6 +116,11 @@ public JobrunrMigrations as(Name alias) { return new JobrunrMigrations(alias, this); } + @Override + public JobrunrMigrations as(Table alias) { + return new JobrunrMigrations(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -135,6 +137,14 @@ public JobrunrMigrations rename(Name name) { return new JobrunrMigrations(name, null); } + /** + * Rename this table + */ + @Override + public JobrunrMigrations rename(Table name) { + return new JobrunrMigrations(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row3 type methods // ------------------------------------------------------------------------- @@ -143,4 +153,19 @@ public JobrunrMigrations rename(Name name) { public Row3 fieldsRow() { return (Row3) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrRecurringJobs.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrRecurringJobs.java index 0298c040a..0fc9bf583 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrRecurringJobs.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/JobrunrRecurringJobs.java @@ -6,16 +6,22 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; +import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.JobrunrRecurringJobsRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function4; +import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row3; +import org.jooq.Records; +import org.jooq.Row4; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -61,6 +67,11 @@ public Class getRecordType() { */ public final TableField JOBASJSON = createField(DSL.name("jobasjson"), SQLDataType.CLOB.nullable(false), this, ""); + /** + * The column public.jobrunr_recurring_jobs.createdat. + */ + public final TableField CREATEDAT = createField(DSL.name("createdat"), SQLDataType.BIGINT.nullable(false).defaultValue(DSL.field(DSL.raw("'0'::bigint"), SQLDataType.BIGINT)), this, ""); + private JobrunrRecurringJobs(Name alias, Table aliased) { this(alias, aliased, null); } @@ -70,14 +81,16 @@ private JobrunrRecurringJobs(Name alias, Table alias } /** - * Create an aliased public.jobrunr_recurring_jobs table reference + * Create an aliased public.jobrunr_recurring_jobs table + * reference */ public JobrunrRecurringJobs(String alias) { this(DSL.name(alias), JOBRUNR_RECURRING_JOBS); } /** - * Create an aliased public.jobrunr_recurring_jobs table reference + * Create an aliased public.jobrunr_recurring_jobs table + * reference */ public JobrunrRecurringJobs(Name alias) { this(alias, JOBRUNR_RECURRING_JOBS); @@ -96,17 +109,17 @@ public JobrunrRecurringJobs(Table child, ForeignKey getPrimaryKey() { - return Keys.JOBRUNR_RECURRING_JOBS_PKEY; + public List getIndexes() { + return Arrays.asList(Indexes.JOBRUNR_RECURRING_JOB_CREATED_AT_IDX); } @Override - public List> getKeys() { - return Arrays.>asList(Keys.JOBRUNR_RECURRING_JOBS_PKEY); + public UniqueKey getPrimaryKey() { + return Keys.JOBRUNR_RECURRING_JOBS_PKEY; } @Override @@ -119,6 +132,11 @@ public JobrunrRecurringJobs as(Name alias) { return new JobrunrRecurringJobs(alias, this); } + @Override + public JobrunrRecurringJobs as(Table alias) { + return new JobrunrRecurringJobs(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -135,12 +153,35 @@ public JobrunrRecurringJobs rename(Name name) { return new JobrunrRecurringJobs(name, null); } + /** + * Rename this table + */ + @Override + public JobrunrRecurringJobs rename(Table name) { + return new JobrunrRecurringJobs(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- - // Row3 type methods + // Row4 type methods // ------------------------------------------------------------------------- @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function4 from) { + return convertFrom(toType, Records.mapping(from)); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/MigrationItem.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/MigrationItem.java index e8f4bd6c1..03cef4190 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/MigrationItem.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/MigrationItem.java @@ -4,18 +4,20 @@ package org.eclipse.openvsx.jooq.tables; -import java.util.Arrays; -import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.MigrationItemRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function4; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row4; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -101,7 +103,7 @@ public MigrationItem(Table child, ForeignKey getPrimaryKey() { return Keys.MIGRATION_ITEM_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.MIGRATION_ITEM_PKEY); - } - @Override public MigrationItem as(String alias) { return new MigrationItem(DSL.name(alias), this); @@ -124,6 +121,11 @@ public MigrationItem as(Name alias) { return new MigrationItem(alias, this); } + @Override + public MigrationItem as(Table alias) { + return new MigrationItem(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -140,6 +142,14 @@ public MigrationItem rename(Name name) { return new MigrationItem(name, null); } + /** + * Rename this table + */ + @Override + public MigrationItem rename(Table name) { + return new MigrationItem(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row4 type methods // ------------------------------------------------------------------------- @@ -148,4 +158,19 @@ public MigrationItem rename(Name name) { public Row4 fieldsRow() { return (Row4) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Namespace.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Namespace.java index fd6bf85f4..259f64e53 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Namespace.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Namespace.java @@ -6,16 +6,20 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.NamespaceRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function11; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row10; +import org.jooq.Records; +import org.jooq.Row11; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -96,6 +100,11 @@ public Class getRecordType() { */ public final TableField LOGO_STORAGE_TYPE = createField(DSL.name("logo_storage_type"), SQLDataType.VARCHAR(32), this, ""); + /** + * The column public.namespace.logo_content_type. + */ + public final TableField LOGO_CONTENT_TYPE = createField(DSL.name("logo_content_type"), SQLDataType.VARCHAR(255), this, ""); + private Namespace(Name alias, Table aliased) { this(alias, aliased, null); } @@ -131,7 +140,7 @@ public Namespace(Table child, ForeignKey getPrimaryKey() { } @Override - public List> getKeys() { - return Arrays.>asList(Keys.NAMESPACE_PKEY, Keys.UNIQUE_NAMESPACE_PUBLIC_ID); + public List> getUniqueKeys() { + return Arrays.asList(Keys.UNIQUE_NAMESPACE_PUBLIC_ID); } @Override @@ -154,6 +163,11 @@ public Namespace as(Name alias) { return new Namespace(alias, this); } + @Override + public Namespace as(Table alias) { + return new Namespace(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -170,12 +184,35 @@ public Namespace rename(Name name) { return new Namespace(name, null); } + /** + * Rename this table + */ + @Override + public Namespace rename(Table name) { + return new Namespace(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- - // Row10 type methods + // Row11 type methods // ------------------------------------------------------------------------- @Override - public Row10 fieldsRow() { - return (Row10) super.fieldsRow(); + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function11 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function11 from) { + return convertFrom(toType, Records.mapping(from)); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceMembership.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceMembership.java index af323e774..dde1dd9cf 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceMembership.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceMembership.java @@ -6,6 +6,7 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; @@ -13,11 +14,14 @@ import org.eclipse.openvsx.jooq.tables.records.NamespaceMembershipRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function4; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row4; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -77,14 +81,16 @@ private NamespaceMembership(Name alias, Table aliased } /** - * Create an aliased public.namespace_membership table reference + * Create an aliased public.namespace_membership table + * reference */ public NamespaceMembership(String alias) { this(DSL.name(alias), NAMESPACE_MEMBERSHIP); } /** - * Create an aliased public.namespace_membership table reference + * Create an aliased public.namespace_membership table + * reference */ public NamespaceMembership(Name alias) { this(alias, NAMESPACE_MEMBERSHIP); @@ -103,12 +109,12 @@ public NamespaceMembership(Table child, ForeignKey getIndexes() { - return Arrays.asList(Indexes.NAMESPACE_MEMBERSHIP__NAMESPACE__IDX, Indexes.NAMESPACE_MEMBERSHIP__USER_DATA__IDX); + return Arrays.asList(Indexes.NAMESPACE_MEMBERSHIP__NAMESPACE__IDX, Indexes.NAMESPACE_MEMBERSHIP__USER_DATA__IDX); } @Override @@ -117,18 +123,21 @@ public UniqueKey getPrimaryKey() { } @Override - public List> getKeys() { - return Arrays.>asList(Keys.NAMESPACE_MEMBERSHIP_PKEY); + public List> getUniqueKeys() { + return Arrays.asList(Keys.UNIQUE_NAMESPACE_MEMBERSHIP); } @Override public List> getReferences() { - return Arrays.>asList(Keys.NAMESPACE_MEMBERSHIP__FKGFHWHKNULA6DO2N6WYVQETM3N, Keys.NAMESPACE_MEMBERSHIP__FKNSAMEKUTXYWVSB3S1MJDCJKYP); + return Arrays.asList(Keys.NAMESPACE_MEMBERSHIP__FKGFHWHKNULA6DO2N6WYVQETM3N, Keys.NAMESPACE_MEMBERSHIP__FKNSAMEKUTXYWVSB3S1MJDCJKYP); } private transient Namespace _namespace; private transient UserData _userData; + /** + * Get the implicit join path to the public.namespace table. + */ public Namespace namespace() { if (_namespace == null) _namespace = new Namespace(this, Keys.NAMESPACE_MEMBERSHIP__FKGFHWHKNULA6DO2N6WYVQETM3N); @@ -136,6 +145,9 @@ public Namespace namespace() { return _namespace; } + /** + * Get the implicit join path to the public.user_data table. + */ public UserData userData() { if (_userData == null) _userData = new UserData(this, Keys.NAMESPACE_MEMBERSHIP__FKNSAMEKUTXYWVSB3S1MJDCJKYP); @@ -153,6 +165,11 @@ public NamespaceMembership as(Name alias) { return new NamespaceMembership(alias, this); } + @Override + public NamespaceMembership as(Table alias) { + return new NamespaceMembership(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -169,6 +186,14 @@ public NamespaceMembership rename(Name name) { return new NamespaceMembership(name, null); } + /** + * Rename this table + */ + @Override + public NamespaceMembership rename(Table name) { + return new NamespaceMembership(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row4 type methods // ------------------------------------------------------------------------- @@ -177,4 +202,19 @@ public NamespaceMembership rename(Name name) { public Row4 fieldsRow() { return (Row4) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceSocialLinks.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceSocialLinks.java index 506c95b8b..5d7cc703a 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceSocialLinks.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/NamespaceSocialLinks.java @@ -6,16 +6,20 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.NamespaceSocialLinksRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function3; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row3; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -69,14 +73,16 @@ private NamespaceSocialLinks(Name alias, Table alias } /** - * Create an aliased public.namespace_social_links table reference + * Create an aliased public.namespace_social_links table + * reference */ public NamespaceSocialLinks(String alias) { this(DSL.name(alias), NAMESPACE_SOCIAL_LINKS); } /** - * Create an aliased public.namespace_social_links table reference + * Create an aliased public.namespace_social_links table + * reference */ public NamespaceSocialLinks(Name alias) { this(alias, NAMESPACE_SOCIAL_LINKS); @@ -95,16 +101,19 @@ public NamespaceSocialLinks(Table child, ForeignKey> getReferences() { - return Arrays.>asList(Keys.NAMESPACE_SOCIAL_LINKS__NAMESPACE_SOCIAL_LINKS_FKEY); + return Arrays.asList(Keys.NAMESPACE_SOCIAL_LINKS__NAMESPACE_SOCIAL_LINKS_FKEY); } private transient Namespace _namespace; + /** + * Get the implicit join path to the public.namespace table. + */ public Namespace namespace() { if (_namespace == null) _namespace = new Namespace(this, Keys.NAMESPACE_SOCIAL_LINKS__NAMESPACE_SOCIAL_LINKS_FKEY); @@ -122,6 +131,11 @@ public NamespaceSocialLinks as(Name alias) { return new NamespaceSocialLinks(alias, this); } + @Override + public NamespaceSocialLinks as(Table alias) { + return new NamespaceSocialLinks(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -138,6 +152,14 @@ public NamespaceSocialLinks rename(Name name) { return new NamespaceSocialLinks(name, null); } + /** + * Rename this table + */ + @Override + public NamespaceSocialLinks rename(Table name) { + return new NamespaceSocialLinks(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row3 type methods // ------------------------------------------------------------------------- @@ -146,4 +168,19 @@ public NamespaceSocialLinks rename(Name name) { public Row3 fieldsRow() { return (Row3) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersistedLog.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersistedLog.java index 015e4f6d5..818b7bdcf 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersistedLog.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersistedLog.java @@ -7,6 +7,7 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; @@ -14,11 +15,14 @@ import org.eclipse.openvsx.jooq.tables.records.PersistedLogRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function4; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row4; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -104,12 +108,12 @@ public PersistedLog(Table child, ForeignKey getIndexes() { - return Arrays.asList(Indexes.PERSISTED_LOG__USER_DATA__IDX); + return Arrays.asList(Indexes.PERSISTED_LOG__USER_DATA__IDX); } @Override @@ -117,18 +121,16 @@ public UniqueKey getPrimaryKey() { return Keys.PERSISTED_LOG_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.PERSISTED_LOG_PKEY); - } - @Override public List> getReferences() { - return Arrays.>asList(Keys.PERSISTED_LOG__PERSISTED_LOG_USER_DATA_FKEY); + return Arrays.asList(Keys.PERSISTED_LOG__PERSISTED_LOG_USER_DATA_FKEY); } private transient UserData _userData; + /** + * Get the implicit join path to the public.user_data table. + */ public UserData userData() { if (_userData == null) _userData = new UserData(this, Keys.PERSISTED_LOG__PERSISTED_LOG_USER_DATA_FKEY); @@ -146,6 +148,11 @@ public PersistedLog as(Name alias) { return new PersistedLog(alias, this); } + @Override + public PersistedLog as(Table alias) { + return new PersistedLog(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -162,6 +169,14 @@ public PersistedLog rename(Name name) { return new PersistedLog(name, null); } + /** + * Rename this table + */ + @Override + public PersistedLog rename(Table name) { + return new PersistedLog(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row4 type methods // ------------------------------------------------------------------------- @@ -170,4 +185,19 @@ public PersistedLog rename(Name name) { public Row4 fieldsRow() { return (Row4) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersonalAccessToken.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersonalAccessToken.java index 5f91c0acc..28814a27d 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersonalAccessToken.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/PersonalAccessToken.java @@ -7,16 +7,20 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.PersonalAccessTokenRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function7; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row7; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -91,14 +95,16 @@ private PersonalAccessToken(Name alias, Table aliased } /** - * Create an aliased public.personal_access_token table reference + * Create an aliased public.personal_access_token table + * reference */ public PersonalAccessToken(String alias) { this(DSL.name(alias), PERSONAL_ACCESS_TOKEN); } /** - * Create an aliased public.personal_access_token table reference + * Create an aliased public.personal_access_token table + * reference */ public PersonalAccessToken(Name alias) { this(alias, PERSONAL_ACCESS_TOKEN); @@ -117,7 +123,7 @@ public PersonalAccessToken(Table child, ForeignKey getPrimaryKey() { } @Override - public List> getKeys() { - return Arrays.>asList(Keys.PERSONAL_ACCESS_TOKEN_PKEY, Keys.UKJEUD5MSSQBQKID58RD2K1INOF); + public List> getUniqueKeys() { + return Arrays.asList(Keys.UKJEUD5MSSQBQKID58RD2K1INOF); } @Override public List> getReferences() { - return Arrays.>asList(Keys.PERSONAL_ACCESS_TOKEN__FKTQJVMHOIG3WTTJ6DL1IBCAJ3L); + return Arrays.asList(Keys.PERSONAL_ACCESS_TOKEN__FKTQJVMHOIG3WTTJ6DL1IBCAJ3L); } private transient UserData _userData; + /** + * Get the implicit join path to the public.user_data table. + */ public UserData userData() { if (_userData == null) _userData = new UserData(this, Keys.PERSONAL_ACCESS_TOKEN__FKTQJVMHOIG3WTTJ6DL1IBCAJ3L); @@ -154,6 +163,11 @@ public PersonalAccessToken as(Name alias) { return new PersonalAccessToken(alias, this); } + @Override + public PersonalAccessToken as(Table alias) { + return new PersonalAccessToken(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -170,6 +184,14 @@ public PersonalAccessToken rename(Name name) { return new PersonalAccessToken(name, null); } + /** + * Rename this table + */ + @Override + public PersonalAccessToken rename(Table name) { + return new PersonalAccessToken(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row7 type methods // ------------------------------------------------------------------------- @@ -178,4 +200,19 @@ public PersonalAccessToken rename(Name name) { public Row7 fieldsRow() { return (Row7) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function7 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function7 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Shedlock.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Shedlock.java index e87d1928c..a72742072 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Shedlock.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Shedlock.java @@ -5,18 +5,20 @@ import java.time.LocalDateTime; -import java.util.Arrays; -import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.ShedlockRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function4; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row4; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -102,7 +104,7 @@ public Shedlock(Table child, ForeignKey @Override public Schema getSchema() { - return Public.PUBLIC; + return aliased() ? null : Public.PUBLIC; } @Override @@ -110,11 +112,6 @@ public UniqueKey getPrimaryKey() { return Keys.SHEDLOCK_PKEY; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.SHEDLOCK_PKEY); - } - @Override public Shedlock as(String alias) { return new Shedlock(DSL.name(alias), this); @@ -125,6 +122,11 @@ public Shedlock as(Name alias) { return new Shedlock(alias, this); } + @Override + public Shedlock as(Table alias) { + return new Shedlock(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -141,6 +143,14 @@ public Shedlock rename(Name name) { return new Shedlock(name, null); } + /** + * Rename this table + */ + @Override + public Shedlock rename(Table name) { + return new Shedlock(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row4 type methods // ------------------------------------------------------------------------- @@ -149,4 +159,19 @@ public Shedlock rename(Name name) { public Row4 fieldsRow() { return (Row4) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function4 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function4 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SignatureKeyPair.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SignatureKeyPair.java index d20d2ed0b..f98d58d02 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SignatureKeyPair.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SignatureKeyPair.java @@ -7,16 +7,20 @@ import java.time.LocalDateTime; import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.SignatureKeyPairRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function6; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row6; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -112,7 +116,7 @@ public SignatureKeyPair(Table child, ForeignKey getPrimaryKey() { } @Override - public List> getKeys() { - return Arrays.>asList(Keys.SIGNATURE_KEY_PAIR_PKEY); + public List> getUniqueKeys() { + return Arrays.asList(Keys.SIGNATURE_KEY_PAIR_UNIQUE_PUBLIC_ID); } @Override @@ -135,6 +139,11 @@ public SignatureKeyPair as(Name alias) { return new SignatureKeyPair(alias, this); } + @Override + public SignatureKeyPair as(Table alias) { + return new SignatureKeyPair(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -151,6 +160,14 @@ public SignatureKeyPair rename(Name name) { return new SignatureKeyPair(name, null); } + /** + * Rename this table + */ + @Override + public SignatureKeyPair rename(Table name) { + return new SignatureKeyPair(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row6 type methods // ------------------------------------------------------------------------- @@ -159,4 +176,19 @@ public SignatureKeyPair rename(Name name) { public Row6 fieldsRow() { return (Row6) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function6 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function6 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSession.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSession.java index 0cd8a578d..56f7839c7 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSession.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSession.java @@ -6,6 +6,7 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Indexes; import org.eclipse.openvsx.jooq.Keys; @@ -13,11 +14,14 @@ import org.eclipse.openvsx.jooq.tables.records.SpringSessionRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function7; import org.jooq.Index; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row7; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -118,12 +122,12 @@ public SpringSession(Table child, ForeignKey getIndexes() { - return Arrays.asList(Indexes.SPRING_SESSION_IX1, Indexes.SPRING_SESSION_IX2, Indexes.SPRING_SESSION_IX3); + return Arrays.asList(Indexes.SPRING_SESSION_IX1, Indexes.SPRING_SESSION_IX2, Indexes.SPRING_SESSION_IX3); } @Override @@ -131,11 +135,6 @@ public UniqueKey getPrimaryKey() { return Keys.SPRING_SESSION_PK; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.SPRING_SESSION_PK); - } - @Override public SpringSession as(String alias) { return new SpringSession(DSL.name(alias), this); @@ -146,6 +145,11 @@ public SpringSession as(Name alias) { return new SpringSession(alias, this); } + @Override + public SpringSession as(Table alias) { + return new SpringSession(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -162,6 +166,14 @@ public SpringSession rename(Name name) { return new SpringSession(name, null); } + /** + * Rename this table + */ + @Override + public SpringSession rename(Table name) { + return new SpringSession(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row7 type methods // ------------------------------------------------------------------------- @@ -170,4 +182,19 @@ public SpringSession rename(Name name) { public Row7 fieldsRow() { return (Row7) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function7 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function7 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSessionAttributes.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSessionAttributes.java index fdae9bd6a..f3694a82e 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSessionAttributes.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/SpringSessionAttributes.java @@ -6,16 +6,20 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.SpringSessionAttributesRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function3; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row3; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -47,7 +51,8 @@ public Class getRecordType() { } /** - * The column public.spring_session_attributes.session_primary_id. + * The column + * public.spring_session_attributes.session_primary_id. */ public final TableField SESSION_PRIMARY_ID = createField(DSL.name("session_primary_id"), SQLDataType.CHAR(36).nullable(false), this, ""); @@ -70,14 +75,16 @@ private SpringSessionAttributes(Name alias, Table } /** - * Create an aliased public.spring_session_attributes table reference + * Create an aliased public.spring_session_attributes table + * reference */ public SpringSessionAttributes(String alias) { this(DSL.name(alias), SPRING_SESSION_ATTRIBUTES); } /** - * Create an aliased public.spring_session_attributes table reference + * Create an aliased public.spring_session_attributes table + * reference */ public SpringSessionAttributes(Name alias) { this(alias, SPRING_SESSION_ATTRIBUTES); @@ -96,7 +103,7 @@ public SpringSessionAttributes(Table child, ForeignKey getPrimaryKey() { return Keys.SPRING_SESSION_ATTRIBUTES_PK; } - @Override - public List> getKeys() { - return Arrays.>asList(Keys.SPRING_SESSION_ATTRIBUTES_PK); - } - @Override public List> getReferences() { - return Arrays.>asList(Keys.SPRING_SESSION_ATTRIBUTES__SPRING_SESSION_ATTRIBUTES_FK); + return Arrays.asList(Keys.SPRING_SESSION_ATTRIBUTES__SPRING_SESSION_ATTRIBUTES_FK); } private transient SpringSession _springSession; + /** + * Get the implicit join path to the public.spring_session + * table. + */ public SpringSession springSession() { if (_springSession == null) _springSession = new SpringSession(this, Keys.SPRING_SESSION_ATTRIBUTES__SPRING_SESSION_ATTRIBUTES_FK); @@ -133,6 +139,11 @@ public SpringSessionAttributes as(Name alias) { return new SpringSessionAttributes(alias, this); } + @Override + public SpringSessionAttributes as(Table alias) { + return new SpringSessionAttributes(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -149,6 +160,14 @@ public SpringSessionAttributes rename(Name name) { return new SpringSessionAttributes(name, null); } + /** + * Rename this table + */ + @Override + public SpringSessionAttributes rename(Table name) { + return new SpringSessionAttributes(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row3 type methods // ------------------------------------------------------------------------- @@ -157,4 +176,19 @@ public SpringSessionAttributes rename(Name name) { public Row3 fieldsRow() { return (Row3) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function3 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function3 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/UserData.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/UserData.java index 571d60d76..4226a606d 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/UserData.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/UserData.java @@ -6,16 +6,20 @@ import java.util.Arrays; import java.util.List; +import java.util.function.Function; import org.eclipse.openvsx.jooq.Keys; import org.eclipse.openvsx.jooq.Public; import org.eclipse.openvsx.jooq.tables.records.UserDataRecord; import org.jooq.Field; import org.jooq.ForeignKey; +import org.jooq.Function12; import org.jooq.Name; import org.jooq.Record; +import org.jooq.Records; import org.jooq.Row12; import org.jooq.Schema; +import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -141,7 +145,7 @@ public UserData(Table child, ForeignKey @Override public Schema getSchema() { - return Public.PUBLIC; + return aliased() ? null : Public.PUBLIC; } @Override @@ -150,8 +154,8 @@ public UniqueKey getPrimaryKey() { } @Override - public List> getKeys() { - return Arrays.>asList(Keys.USER_DATA_PKEY); + public List> getUniqueKeys() { + return Arrays.asList(Keys.UNIQUE_USER_DATA); } @Override @@ -164,6 +168,11 @@ public UserData as(Name alias) { return new UserData(alias, this); } + @Override + public UserData as(Table alias) { + return new UserData(alias.getQualifiedName(), this); + } + /** * Rename this table */ @@ -180,6 +189,14 @@ public UserData rename(Name name) { return new UserData(name, null); } + /** + * Rename this table + */ + @Override + public UserData rename(Table name) { + return new UserData(name.getQualifiedName(), null); + } + // ------------------------------------------------------------------------- // Row12 type methods // ------------------------------------------------------------------------- @@ -188,4 +205,19 @@ public UserData rename(Name name) { public Row12 fieldsRow() { return (Row12) super.fieldsRow(); } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + */ + public SelectField mapping(Function12 from) { + return convertFrom(Records.mapping(from)); + } + + /** + * Convenience mapping calling {@link SelectField#convertFrom(Class, + * Function)}. + */ + public SelectField mapping(Class toType, Function12 from) { + return convertFrom(toType, Records.mapping(from)); + } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsExtensionsByRatingRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsExtensionsByRatingRecord.java index fb8bcd403..8a65e2676 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsExtensionsByRatingRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsExtensionsByRatingRecord.java @@ -20,42 +20,48 @@ public class AdminStatisticsExtensionsByRatingRecord extends TableRecordImplpublic.admin_statistics_extensions_by_rating.admin_statistics_id. + * Setter for + * public.admin_statistics_extensions_by_rating.admin_statistics_id. */ public void setAdminStatisticsId(Long value) { set(0, value); } /** - * Getter for public.admin_statistics_extensions_by_rating.admin_statistics_id. + * Getter for + * public.admin_statistics_extensions_by_rating.admin_statistics_id. */ public Long getAdminStatisticsId() { return (Long) get(0); } /** - * Setter for public.admin_statistics_extensions_by_rating.rating. + * Setter for + * public.admin_statistics_extensions_by_rating.rating. */ public void setRating(Integer value) { set(1, value); } /** - * Getter for public.admin_statistics_extensions_by_rating.rating. + * Getter for + * public.admin_statistics_extensions_by_rating.rating. */ public Integer getRating() { return (Integer) get(1); } /** - * Setter for public.admin_statistics_extensions_by_rating.extensions. + * Setter for + * public.admin_statistics_extensions_by_rating.extensions. */ public void setExtensions(Integer value) { set(2, value); } /** - * Getter for public.admin_statistics_extensions_by_rating.extensions. + * Getter for + * public.admin_statistics_extensions_by_rating.extensions. */ public Integer getExtensions() { return (Integer) get(2); @@ -166,5 +172,6 @@ public AdminStatisticsExtensionsByRatingRecord(Long adminStatisticsId, Integer r setAdminStatisticsId(adminStatisticsId); setRating(rating); setExtensions(extensions); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsPublishersByExtensionsPublishedRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsPublishersByExtensionsPublishedRecord.java index 9515e8f69..a17c5db97 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsPublishersByExtensionsPublishedRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsPublishersByExtensionsPublishedRecord.java @@ -20,42 +20,48 @@ public class AdminStatisticsPublishersByExtensionsPublishedRecord extends TableR private static final long serialVersionUID = 1L; /** - * Setter for public.admin_statistics_publishers_by_extensions_published.admin_statistics_id. + * Setter for + * public.admin_statistics_publishers_by_extensions_published.admin_statistics_id. */ public void setAdminStatisticsId(Long value) { set(0, value); } /** - * Getter for public.admin_statistics_publishers_by_extensions_published.admin_statistics_id. + * Getter for + * public.admin_statistics_publishers_by_extensions_published.admin_statistics_id. */ public Long getAdminStatisticsId() { return (Long) get(0); } /** - * Setter for public.admin_statistics_publishers_by_extensions_published.extensions_published. + * Setter for + * public.admin_statistics_publishers_by_extensions_published.extensions_published. */ public void setExtensionsPublished(Integer value) { set(1, value); } /** - * Getter for public.admin_statistics_publishers_by_extensions_published.extensions_published. + * Getter for + * public.admin_statistics_publishers_by_extensions_published.extensions_published. */ public Integer getExtensionsPublished() { return (Integer) get(1); } /** - * Setter for public.admin_statistics_publishers_by_extensions_published.publishers. + * Setter for + * public.admin_statistics_publishers_by_extensions_published.publishers. */ public void setPublishers(Integer value) { set(2, value); } /** - * Getter for public.admin_statistics_publishers_by_extensions_published.publishers. + * Getter for + * public.admin_statistics_publishers_by_extensions_published.publishers. */ public Integer getPublishers() { return (Integer) get(2); @@ -158,7 +164,8 @@ public AdminStatisticsPublishersByExtensionsPublishedRecord() { } /** - * Create a detached, initialised AdminStatisticsPublishersByExtensionsPublishedRecord + * Create a detached, initialised + * AdminStatisticsPublishersByExtensionsPublishedRecord */ public AdminStatisticsPublishersByExtensionsPublishedRecord(Long adminStatisticsId, Integer extensionsPublished, Integer publishers) { super(AdminStatisticsPublishersByExtensionsPublished.ADMIN_STATISTICS_PUBLISHERS_BY_EXTENSIONS_PUBLISHED); @@ -166,5 +173,6 @@ public AdminStatisticsPublishersByExtensionsPublishedRecord(Long adminStatistics setAdminStatisticsId(adminStatisticsId); setExtensionsPublished(extensionsPublished); setPublishers(publishers); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsRecord.java index 6e14fdc52..5ff8cbc68 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsRecord.java @@ -119,14 +119,16 @@ public Long getPublishers() { } /** - * Setter for public.admin_statistics.average_reviews_per_extension. + * Setter for + * public.admin_statistics.average_reviews_per_extension. */ public void setAverageReviewsPerExtension(Double value) { set(7, value); } /** - * Getter for public.admin_statistics.average_reviews_per_extension. + * Getter for + * public.admin_statistics.average_reviews_per_extension. */ public Double getAverageReviewsPerExtension() { return (Double) get(7); @@ -398,5 +400,6 @@ public AdminStatisticsRecord(Long id, Integer year, Integer month, Long extensio setPublishers(publishers); setAverageReviewsPerExtension(averageReviewsPerExtension); setNamespaceOwners(namespaceOwners); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostActivePublishingUsersRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostActivePublishingUsersRecord.java index 136d12297..0af843772 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostActivePublishingUsersRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostActivePublishingUsersRecord.java @@ -20,42 +20,48 @@ public class AdminStatisticsTopMostActivePublishingUsersRecord extends TableReco private static final long serialVersionUID = 1L; /** - * Setter for public.admin_statistics_top_most_active_publishing_users.admin_statistics_id. + * Setter for + * public.admin_statistics_top_most_active_publishing_users.admin_statistics_id. */ public void setAdminStatisticsId(Long value) { set(0, value); } /** - * Getter for public.admin_statistics_top_most_active_publishing_users.admin_statistics_id. + * Getter for + * public.admin_statistics_top_most_active_publishing_users.admin_statistics_id. */ public Long getAdminStatisticsId() { return (Long) get(0); } /** - * Setter for public.admin_statistics_top_most_active_publishing_users.login_name. + * Setter for + * public.admin_statistics_top_most_active_publishing_users.login_name. */ public void setLoginName(String value) { set(1, value); } /** - * Getter for public.admin_statistics_top_most_active_publishing_users.login_name. + * Getter for + * public.admin_statistics_top_most_active_publishing_users.login_name. */ public String getLoginName() { return (String) get(1); } /** - * Setter for public.admin_statistics_top_most_active_publishing_users.extension_version_count. + * Setter for + * public.admin_statistics_top_most_active_publishing_users.extension_version_count. */ public void setExtensionVersionCount(Integer value) { set(2, value); } /** - * Getter for public.admin_statistics_top_most_active_publishing_users.extension_version_count. + * Getter for + * public.admin_statistics_top_most_active_publishing_users.extension_version_count. */ public Integer getExtensionVersionCount() { return (Integer) get(2); @@ -158,7 +164,8 @@ public AdminStatisticsTopMostActivePublishingUsersRecord() { } /** - * Create a detached, initialised AdminStatisticsTopMostActivePublishingUsersRecord + * Create a detached, initialised + * AdminStatisticsTopMostActivePublishingUsersRecord */ public AdminStatisticsTopMostActivePublishingUsersRecord(Long adminStatisticsId, String loginName, Integer extensionVersionCount) { super(AdminStatisticsTopMostActivePublishingUsers.ADMIN_STATISTICS_TOP_MOST_ACTIVE_PUBLISHING_USERS); @@ -166,5 +173,6 @@ public AdminStatisticsTopMostActivePublishingUsersRecord(Long adminStatisticsId, setAdminStatisticsId(adminStatisticsId); setLoginName(loginName); setExtensionVersionCount(extensionVersionCount); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostDownloadedExtensionsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostDownloadedExtensionsRecord.java index 055f36550..7fca6f177 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostDownloadedExtensionsRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopMostDownloadedExtensionsRecord.java @@ -20,42 +20,48 @@ public class AdminStatisticsTopMostDownloadedExtensionsRecord extends TableRecor private static final long serialVersionUID = 1L; /** - * Setter for public.admin_statistics_top_most_downloaded_extensions.admin_statistics_id. + * Setter for + * public.admin_statistics_top_most_downloaded_extensions.admin_statistics_id. */ public void setAdminStatisticsId(Long value) { set(0, value); } /** - * Getter for public.admin_statistics_top_most_downloaded_extensions.admin_statistics_id. + * Getter for + * public.admin_statistics_top_most_downloaded_extensions.admin_statistics_id. */ public Long getAdminStatisticsId() { return (Long) get(0); } /** - * Setter for public.admin_statistics_top_most_downloaded_extensions.extension_identifier. + * Setter for + * public.admin_statistics_top_most_downloaded_extensions.extension_identifier. */ public void setExtensionIdentifier(String value) { set(1, value); } /** - * Getter for public.admin_statistics_top_most_downloaded_extensions.extension_identifier. + * Getter for + * public.admin_statistics_top_most_downloaded_extensions.extension_identifier. */ public String getExtensionIdentifier() { return (String) get(1); } /** - * Setter for public.admin_statistics_top_most_downloaded_extensions.downloads. + * Setter for + * public.admin_statistics_top_most_downloaded_extensions.downloads. */ public void setDownloads(Long value) { set(2, value); } /** - * Getter for public.admin_statistics_top_most_downloaded_extensions.downloads. + * Getter for + * public.admin_statistics_top_most_downloaded_extensions.downloads. */ public Long getDownloads() { return (Long) get(2); @@ -158,7 +164,8 @@ public AdminStatisticsTopMostDownloadedExtensionsRecord() { } /** - * Create a detached, initialised AdminStatisticsTopMostDownloadedExtensionsRecord + * Create a detached, initialised + * AdminStatisticsTopMostDownloadedExtensionsRecord */ public AdminStatisticsTopMostDownloadedExtensionsRecord(Long adminStatisticsId, String extensionIdentifier, Long downloads) { super(AdminStatisticsTopMostDownloadedExtensions.ADMIN_STATISTICS_TOP_MOST_DOWNLOADED_EXTENSIONS); @@ -166,5 +173,6 @@ public AdminStatisticsTopMostDownloadedExtensionsRecord(Long adminStatisticsId, setAdminStatisticsId(adminStatisticsId); setExtensionIdentifier(extensionIdentifier); setDownloads(downloads); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionVersionsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionVersionsRecord.java index 09ca331ad..a72922e30 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionVersionsRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionVersionsRecord.java @@ -20,42 +20,48 @@ public class AdminStatisticsTopNamespaceExtensionVersionsRecord extends TableRec private static final long serialVersionUID = 1L; /** - * Setter for public.admin_statistics_top_namespace_extension_versions.admin_statistics_id. + * Setter for + * public.admin_statistics_top_namespace_extension_versions.admin_statistics_id. */ public void setAdminStatisticsId(Long value) { set(0, value); } /** - * Getter for public.admin_statistics_top_namespace_extension_versions.admin_statistics_id. + * Getter for + * public.admin_statistics_top_namespace_extension_versions.admin_statistics_id. */ public Long getAdminStatisticsId() { return (Long) get(0); } /** - * Setter for public.admin_statistics_top_namespace_extension_versions.namespace. + * Setter for + * public.admin_statistics_top_namespace_extension_versions.namespace. */ public void setNamespace(String value) { set(1, value); } /** - * Getter for public.admin_statistics_top_namespace_extension_versions.namespace. + * Getter for + * public.admin_statistics_top_namespace_extension_versions.namespace. */ public String getNamespace() { return (String) get(1); } /** - * Setter for public.admin_statistics_top_namespace_extension_versions.extension_version_count. + * Setter for + * public.admin_statistics_top_namespace_extension_versions.extension_version_count. */ public void setExtensionVersionCount(Integer value) { set(2, value); } /** - * Getter for public.admin_statistics_top_namespace_extension_versions.extension_version_count. + * Getter for + * public.admin_statistics_top_namespace_extension_versions.extension_version_count. */ public Integer getExtensionVersionCount() { return (Integer) get(2); @@ -158,7 +164,8 @@ public AdminStatisticsTopNamespaceExtensionVersionsRecord() { } /** - * Create a detached, initialised AdminStatisticsTopNamespaceExtensionVersionsRecord + * Create a detached, initialised + * AdminStatisticsTopNamespaceExtensionVersionsRecord */ public AdminStatisticsTopNamespaceExtensionVersionsRecord(Long adminStatisticsId, String namespace, Integer extensionVersionCount) { super(AdminStatisticsTopNamespaceExtensionVersions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSION_VERSIONS); @@ -166,5 +173,6 @@ public AdminStatisticsTopNamespaceExtensionVersionsRecord(Long adminStatisticsId setAdminStatisticsId(adminStatisticsId); setNamespace(namespace); setExtensionVersionCount(extensionVersionCount); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionsRecord.java index 59afe09ea..ed69862c8 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionsRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AdminStatisticsTopNamespaceExtensionsRecord.java @@ -20,42 +20,48 @@ public class AdminStatisticsTopNamespaceExtensionsRecord extends TableRecordImpl private static final long serialVersionUID = 1L; /** - * Setter for public.admin_statistics_top_namespace_extensions.admin_statistics_id. + * Setter for + * public.admin_statistics_top_namespace_extensions.admin_statistics_id. */ public void setAdminStatisticsId(Long value) { set(0, value); } /** - * Getter for public.admin_statistics_top_namespace_extensions.admin_statistics_id. + * Getter for + * public.admin_statistics_top_namespace_extensions.admin_statistics_id. */ public Long getAdminStatisticsId() { return (Long) get(0); } /** - * Setter for public.admin_statistics_top_namespace_extensions.namespace. + * Setter for + * public.admin_statistics_top_namespace_extensions.namespace. */ public void setNamespace(String value) { set(1, value); } /** - * Getter for public.admin_statistics_top_namespace_extensions.namespace. + * Getter for + * public.admin_statistics_top_namespace_extensions.namespace. */ public String getNamespace() { return (String) get(1); } /** - * Setter for public.admin_statistics_top_namespace_extensions.extension_count. + * Setter for + * public.admin_statistics_top_namespace_extensions.extension_count. */ public void setExtensionCount(Integer value) { set(2, value); } /** - * Getter for public.admin_statistics_top_namespace_extensions.extension_count. + * Getter for + * public.admin_statistics_top_namespace_extensions.extension_count. */ public Integer getExtensionCount() { return (Integer) get(2); @@ -158,7 +164,8 @@ public AdminStatisticsTopNamespaceExtensionsRecord() { } /** - * Create a detached, initialised AdminStatisticsTopNamespaceExtensionsRecord + * Create a detached, initialised + * AdminStatisticsTopNamespaceExtensionsRecord */ public AdminStatisticsTopNamespaceExtensionsRecord(Long adminStatisticsId, String namespace, Integer extensionCount) { super(AdminStatisticsTopNamespaceExtensions.ADMIN_STATISTICS_TOP_NAMESPACE_EXTENSIONS); @@ -166,5 +173,6 @@ public AdminStatisticsTopNamespaceExtensionsRecord(Long adminStatisticsId, Strin setAdminStatisticsId(adminStatisticsId); setNamespace(namespace); setExtensionCount(extensionCount); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AzureDownloadCountProcessedItemRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AzureDownloadCountProcessedItemRecord.java index 1d5bd23ce..c0357acea 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AzureDownloadCountProcessedItemRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/AzureDownloadCountProcessedItemRecord.java @@ -51,42 +51,48 @@ public String getName() { } /** - * Setter for public.azure_download_count_processed_item.processed_on. + * Setter for + * public.azure_download_count_processed_item.processed_on. */ public void setProcessedOn(LocalDateTime value) { set(2, value); } /** - * Getter for public.azure_download_count_processed_item.processed_on. + * Getter for + * public.azure_download_count_processed_item.processed_on. */ public LocalDateTime getProcessedOn() { return (LocalDateTime) get(2); } /** - * Setter for public.azure_download_count_processed_item.execution_time. + * Setter for + * public.azure_download_count_processed_item.execution_time. */ public void setExecutionTime(Integer value) { set(3, value); } /** - * Getter for public.azure_download_count_processed_item.execution_time. + * Getter for + * public.azure_download_count_processed_item.execution_time. */ public Integer getExecutionTime() { return (Integer) get(3); } /** - * Setter for public.azure_download_count_processed_item.success. + * Setter for + * public.azure_download_count_processed_item.success. */ public void setSuccess(Boolean value) { set(4, value); } /** - * Getter for public.azure_download_count_processed_item.success. + * Getter for + * public.azure_download_count_processed_item.success. */ public Boolean getSuccess() { return (Boolean) get(4); @@ -252,5 +258,6 @@ public AzureDownloadCountProcessedItemRecord(Long id, String name, LocalDateTime setProcessedOn(processedOn); setExecutionTime(executionTime); setSuccess(success); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/DownloadRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/DownloadRecord.java index 9a88a455c..fcd766b7e 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/DownloadRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/DownloadRecord.java @@ -215,5 +215,6 @@ public DownloadRecord(Long id, Long fileResourceIdNotFk, LocalDateTime timestamp setFileResourceIdNotFk(fileResourceIdNotFk); setTimestamp(timestamp); setAmount(amount); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/EntityActiveStateRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/EntityActiveStateRecord.java index b4b8447bf..ad2d7e4d4 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/EntityActiveStateRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/EntityActiveStateRecord.java @@ -252,5 +252,6 @@ public EntityActiveStateRecord(Long id, Long entityId, String entityType, Boolea setEntityType(entityType); setActive(active); setTimestamp(timestamp); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionRecord.java index 2ba41e704..c3157673a 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionRecord.java @@ -437,5 +437,6 @@ public ExtensionRecord(Long id, Double averageRating, Integer downloadCount, Str setPublishedDate(publishedDate); setLastUpdatedDate(lastUpdatedDate); setReviewCount(reviewCount); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionReviewRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionReviewRecord.java index a00a740b3..1f953b4df 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionReviewRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionReviewRecord.java @@ -363,5 +363,6 @@ public ExtensionReviewRecord(Long id, Boolean active, String comment, Integer ra setTitle(title); setExtensionId(extensionId); setUserId(userId); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionVersionRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionVersionRecord.java index 96874923d..927494f36 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionVersionRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionVersionRecord.java @@ -496,14 +496,16 @@ public String getSemverBuildMetadata() { } /** - * Setter for public.extension_version.universal_target_platform. + * Setter for + * public.extension_version.universal_target_platform. */ public void setUniversalTargetPlatform(Boolean value) { set(34, value); } /** - * Getter for public.extension_version.universal_target_platform. + * Getter for + * public.extension_version.universal_target_platform. */ public Boolean getUniversalTargetPlatform() { return (Boolean) get(34); @@ -570,5 +572,6 @@ public ExtensionVersionRecord(Long id, String bugs, String description, String d setSemverIsPreRelease(semverIsPreRelease); setSemverBuildMetadata(semverBuildMetadata); setUniversalTargetPlatform(universalTargetPlatform); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FileResourceRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FileResourceRecord.java index 8203f55f1..8206d975a 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FileResourceRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FileResourceRecord.java @@ -7,8 +7,8 @@ import org.eclipse.openvsx.jooq.tables.FileResource; import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record6; -import org.jooq.Row6; +import org.jooq.Record7; +import org.jooq.Row7; import org.jooq.impl.UpdatableRecordImpl; @@ -16,7 +16,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class FileResourceRecord extends UpdatableRecordImpl implements Record6 { +public class FileResourceRecord extends UpdatableRecordImpl implements Record7 { private static final long serialVersionUID = 1L; @@ -104,6 +104,20 @@ public String getStorageType() { return (String) get(5); } + /** + * Setter for public.file_resource.content_type. + */ + public void setContentType(String value) { + set(6, value); + } + + /** + * Getter for public.file_resource.content_type. + */ + public String getContentType() { + return (String) get(6); + } + // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @@ -114,17 +128,17 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record6 type implementation + // Record7 type implementation // ------------------------------------------------------------------------- @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + public Row7 fieldsRow() { + return (Row7) super.fieldsRow(); } @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); + public Row7 valuesRow() { + return (Row7) super.valuesRow(); } @Override @@ -157,6 +171,11 @@ public Field field6() { return FileResource.FILE_RESOURCE.STORAGE_TYPE; } + @Override + public Field field7() { + return FileResource.FILE_RESOURCE.CONTENT_TYPE; + } + @Override public Long component1() { return getId(); @@ -187,6 +206,11 @@ public String component6() { return getStorageType(); } + @Override + public String component7() { + return getContentType(); + } + @Override public Long value1() { return getId(); @@ -217,6 +241,11 @@ public String value6() { return getStorageType(); } + @Override + public String value7() { + return getContentType(); + } + @Override public FileResourceRecord value1(Long value) { setId(value); @@ -254,13 +283,20 @@ public FileResourceRecord value6(String value) { } @Override - public FileResourceRecord values(Long value1, String value2, byte[] value3, Long value4, String value5, String value6) { + public FileResourceRecord value7(String value) { + setContentType(value); + return this; + } + + @Override + public FileResourceRecord values(Long value1, String value2, byte[] value3, Long value4, String value5, String value6, String value7) { value1(value1); value2(value2); value3(value3); value4(value4); value5(value5); value6(value6); + value7(value7); return this; } @@ -278,7 +314,7 @@ public FileResourceRecord() { /** * Create a detached, initialised FileResourceRecord */ - public FileResourceRecord(Long id, String type, byte[] content, Long extensionId, String name, String storageType) { + public FileResourceRecord(Long id, String type, byte[] content, Long extensionId, String name, String storageType, String contentType) { super(FileResource.FILE_RESOURCE); setId(id); @@ -287,5 +323,7 @@ public FileResourceRecord(Long id, String type, byte[] content, Long extensionId setExtensionId(extensionId); setName(name); setStorageType(storageType); + setContentType(contentType); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FlywaySchemaHistoryRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FlywaySchemaHistoryRecord.java index 17daedd20..e7332bbaf 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FlywaySchemaHistoryRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/FlywaySchemaHistoryRecord.java @@ -437,5 +437,6 @@ public FlywaySchemaHistoryRecord(Integer installedRank, String version, String d setInstalledOn(installedOn); setExecutionTime(executionTime); setSuccess(success); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrBackgroundjobserversRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrBackgroundjobserversRecord.java index 0acb48250..418ccedd0 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrBackgroundjobserversRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrBackgroundjobserversRecord.java @@ -10,8 +10,8 @@ import org.eclipse.openvsx.jooq.tables.JobrunrBackgroundjobservers; import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record15; -import org.jooq.Row15; +import org.jooq.Record16; +import org.jooq.Row16; import org.jooq.impl.UpdatableRecordImpl; @@ -19,7 +19,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JobrunrBackgroundjobserversRecord extends UpdatableRecordImpl implements Record15 { +public class JobrunrBackgroundjobserversRecord extends UpdatableRecordImpl implements Record16 { private static final long serialVersionUID = 1L; @@ -38,56 +38,64 @@ public String getId() { } /** - * Setter for public.jobrunr_backgroundjobservers.workerpoolsize. + * Setter for + * public.jobrunr_backgroundjobservers.workerpoolsize. */ public void setWorkerpoolsize(Integer value) { set(1, value); } /** - * Getter for public.jobrunr_backgroundjobservers.workerpoolsize. + * Getter for + * public.jobrunr_backgroundjobservers.workerpoolsize. */ public Integer getWorkerpoolsize() { return (Integer) get(1); } /** - * Setter for public.jobrunr_backgroundjobservers.pollintervalinseconds. + * Setter for + * public.jobrunr_backgroundjobservers.pollintervalinseconds. */ public void setPollintervalinseconds(Integer value) { set(2, value); } /** - * Getter for public.jobrunr_backgroundjobservers.pollintervalinseconds. + * Getter for + * public.jobrunr_backgroundjobservers.pollintervalinseconds. */ public Integer getPollintervalinseconds() { return (Integer) get(2); } /** - * Setter for public.jobrunr_backgroundjobservers.firstheartbeat. + * Setter for + * public.jobrunr_backgroundjobservers.firstheartbeat. */ public void setFirstheartbeat(LocalDateTime value) { set(3, value); } /** - * Getter for public.jobrunr_backgroundjobservers.firstheartbeat. + * Getter for + * public.jobrunr_backgroundjobservers.firstheartbeat. */ public LocalDateTime getFirstheartbeat() { return (LocalDateTime) get(3); } /** - * Setter for public.jobrunr_backgroundjobservers.lastheartbeat. + * Setter for + * public.jobrunr_backgroundjobservers.lastheartbeat. */ public void setLastheartbeat(LocalDateTime value) { set(4, value); } /** - * Getter for public.jobrunr_backgroundjobservers.lastheartbeat. + * Getter for + * public.jobrunr_backgroundjobservers.lastheartbeat. */ public LocalDateTime getLastheartbeat() { return (LocalDateTime) get(4); @@ -108,131 +116,163 @@ public Integer getRunning() { } /** - * Setter for public.jobrunr_backgroundjobservers.systemtotalmemory. + * Setter for + * public.jobrunr_backgroundjobservers.systemtotalmemory. */ public void setSystemtotalmemory(Long value) { set(6, value); } /** - * Getter for public.jobrunr_backgroundjobservers.systemtotalmemory. + * Getter for + * public.jobrunr_backgroundjobservers.systemtotalmemory. */ public Long getSystemtotalmemory() { return (Long) get(6); } /** - * Setter for public.jobrunr_backgroundjobservers.systemfreememory. + * Setter for + * public.jobrunr_backgroundjobservers.systemfreememory. */ public void setSystemfreememory(Long value) { set(7, value); } /** - * Getter for public.jobrunr_backgroundjobservers.systemfreememory. + * Getter for + * public.jobrunr_backgroundjobservers.systemfreememory. */ public Long getSystemfreememory() { return (Long) get(7); } /** - * Setter for public.jobrunr_backgroundjobservers.systemcpuload. + * Setter for + * public.jobrunr_backgroundjobservers.systemcpuload. */ public void setSystemcpuload(BigDecimal value) { set(8, value); } /** - * Getter for public.jobrunr_backgroundjobservers.systemcpuload. + * Getter for + * public.jobrunr_backgroundjobservers.systemcpuload. */ public BigDecimal getSystemcpuload() { return (BigDecimal) get(8); } /** - * Setter for public.jobrunr_backgroundjobservers.processmaxmemory. + * Setter for + * public.jobrunr_backgroundjobservers.processmaxmemory. */ public void setProcessmaxmemory(Long value) { set(9, value); } /** - * Getter for public.jobrunr_backgroundjobservers.processmaxmemory. + * Getter for + * public.jobrunr_backgroundjobservers.processmaxmemory. */ public Long getProcessmaxmemory() { return (Long) get(9); } /** - * Setter for public.jobrunr_backgroundjobservers.processfreememory. + * Setter for + * public.jobrunr_backgroundjobservers.processfreememory. */ public void setProcessfreememory(Long value) { set(10, value); } /** - * Getter for public.jobrunr_backgroundjobservers.processfreememory. + * Getter for + * public.jobrunr_backgroundjobservers.processfreememory. */ public Long getProcessfreememory() { return (Long) get(10); } /** - * Setter for public.jobrunr_backgroundjobservers.processallocatedmemory. + * Setter for + * public.jobrunr_backgroundjobservers.processallocatedmemory. */ public void setProcessallocatedmemory(Long value) { set(11, value); } /** - * Getter for public.jobrunr_backgroundjobservers.processallocatedmemory. + * Getter for + * public.jobrunr_backgroundjobservers.processallocatedmemory. */ public Long getProcessallocatedmemory() { return (Long) get(11); } /** - * Setter for public.jobrunr_backgroundjobservers.processcpuload. + * Setter for + * public.jobrunr_backgroundjobservers.processcpuload. */ public void setProcesscpuload(BigDecimal value) { set(12, value); } /** - * Getter for public.jobrunr_backgroundjobservers.processcpuload. + * Getter for + * public.jobrunr_backgroundjobservers.processcpuload. */ public BigDecimal getProcesscpuload() { return (BigDecimal) get(12); } /** - * Setter for public.jobrunr_backgroundjobservers.deletesucceededjobsafter. + * Setter for + * public.jobrunr_backgroundjobservers.deletesucceededjobsafter. */ public void setDeletesucceededjobsafter(String value) { set(13, value); } /** - * Getter for public.jobrunr_backgroundjobservers.deletesucceededjobsafter. + * Getter for + * public.jobrunr_backgroundjobservers.deletesucceededjobsafter. */ public String getDeletesucceededjobsafter() { return (String) get(13); } /** - * Setter for public.jobrunr_backgroundjobservers.permanentlydeletejobsafter. + * Setter for + * public.jobrunr_backgroundjobservers.permanentlydeletejobsafter. */ public void setPermanentlydeletejobsafter(String value) { set(14, value); } /** - * Getter for public.jobrunr_backgroundjobservers.permanentlydeletejobsafter. + * Getter for + * public.jobrunr_backgroundjobservers.permanentlydeletejobsafter. */ public String getPermanentlydeletejobsafter() { return (String) get(14); } + /** + * Setter for public.jobrunr_backgroundjobservers.name. + */ + public void setName(String value) { + set(15, value); + } + + /** + * Getter for public.jobrunr_backgroundjobservers.name. + */ + public String getName() { + return (String) get(15); + } + // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @@ -243,17 +283,17 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record15 type implementation + // Record16 type implementation // ------------------------------------------------------------------------- @Override - public Row15 fieldsRow() { - return (Row15) super.fieldsRow(); + public Row16 fieldsRow() { + return (Row16) super.fieldsRow(); } @Override - public Row15 valuesRow() { - return (Row15) super.valuesRow(); + public Row16 valuesRow() { + return (Row16) super.valuesRow(); } @Override @@ -331,6 +371,11 @@ public Field field15() { return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.PERMANENTLYDELETEJOBSAFTER; } + @Override + public Field field16() { + return JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS.NAME; + } + @Override public String component1() { return getId(); @@ -406,6 +451,11 @@ public String component15() { return getPermanentlydeletejobsafter(); } + @Override + public String component16() { + return getName(); + } + @Override public String value1() { return getId(); @@ -481,6 +531,11 @@ public String value15() { return getPermanentlydeletejobsafter(); } + @Override + public String value16() { + return getName(); + } + @Override public JobrunrBackgroundjobserversRecord value1(String value) { setId(value); @@ -572,7 +627,13 @@ public JobrunrBackgroundjobserversRecord value15(String value) { } @Override - public JobrunrBackgroundjobserversRecord values(String value1, Integer value2, Integer value3, LocalDateTime value4, LocalDateTime value5, Integer value6, Long value7, Long value8, BigDecimal value9, Long value10, Long value11, Long value12, BigDecimal value13, String value14, String value15) { + public JobrunrBackgroundjobserversRecord value16(String value) { + setName(value); + return this; + } + + @Override + public JobrunrBackgroundjobserversRecord values(String value1, Integer value2, Integer value3, LocalDateTime value4, LocalDateTime value5, Integer value6, Long value7, Long value8, BigDecimal value9, Long value10, Long value11, Long value12, BigDecimal value13, String value14, String value15, String value16) { value1(value1); value2(value2); value3(value3); @@ -588,6 +649,7 @@ public JobrunrBackgroundjobserversRecord values(String value1, Integer value2, I value13(value13); value14(value14); value15(value15); + value16(value16); return this; } @@ -605,7 +667,7 @@ public JobrunrBackgroundjobserversRecord() { /** * Create a detached, initialised JobrunrBackgroundjobserversRecord */ - public JobrunrBackgroundjobserversRecord(String id, Integer workerpoolsize, Integer pollintervalinseconds, LocalDateTime firstheartbeat, LocalDateTime lastheartbeat, Integer running, Long systemtotalmemory, Long systemfreememory, BigDecimal systemcpuload, Long processmaxmemory, Long processfreememory, Long processallocatedmemory, BigDecimal processcpuload, String deletesucceededjobsafter, String permanentlydeletejobsafter) { + public JobrunrBackgroundjobserversRecord(String id, Integer workerpoolsize, Integer pollintervalinseconds, LocalDateTime firstheartbeat, LocalDateTime lastheartbeat, Integer running, Long systemtotalmemory, Long systemfreememory, BigDecimal systemcpuload, Long processmaxmemory, Long processfreememory, Long processallocatedmemory, BigDecimal processcpuload, String deletesucceededjobsafter, String permanentlydeletejobsafter, String name) { super(JobrunrBackgroundjobservers.JOBRUNR_BACKGROUNDJOBSERVERS); setId(id); @@ -623,5 +685,7 @@ public JobrunrBackgroundjobserversRecord(String id, Integer workerpoolsize, Inte setProcesscpuload(processcpuload); setDeletesucceededjobsafter(deletesucceededjobsafter); setPermanentlydeletejobsafter(permanentlydeletejobsafter); + setName(name); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsRecord.java index b2bfa0a57..a2612d47b 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsRecord.java @@ -400,5 +400,6 @@ public JobrunrJobsRecord(String id, Integer version, String jobasjson, String jo setUpdatedat(updatedat); setScheduledat(scheduledat); setRecurringjobid(recurringjobid); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsStatsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsStatsRecord.java index 40cadbd0b..e5f82a233 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsStatsRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrJobsStatsRecord.java @@ -4,10 +4,12 @@ package org.eclipse.openvsx.jooq.tables.records; +import java.math.BigDecimal; + import org.eclipse.openvsx.jooq.tables.JobrunrJobsStats; import org.jooq.Field; -import org.jooq.Record11; -import org.jooq.Row11; +import org.jooq.Record10; +import org.jooq.Row10; import org.jooq.impl.TableRecordImpl; @@ -15,7 +17,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JobrunrJobsStatsRecord extends TableRecordImpl implements Record11 { +public class JobrunrJobsStatsRecord extends TableRecordImpl implements Record10 { private static final long serialVersionUID = 1L; @@ -33,158 +35,146 @@ public Long getTotal() { return (Long) get(0); } - /** - * Setter for public.jobrunr_jobs_stats.awaiting. - */ - public void setAwaiting(Long value) { - set(1, value); - } - - /** - * Getter for public.jobrunr_jobs_stats.awaiting. - */ - public Long getAwaiting() { - return (Long) get(1); - } - /** * Setter for public.jobrunr_jobs_stats.scheduled. */ public void setScheduled(Long value) { - set(2, value); + set(1, value); } /** * Getter for public.jobrunr_jobs_stats.scheduled. */ public Long getScheduled() { - return (Long) get(2); + return (Long) get(1); } /** * Setter for public.jobrunr_jobs_stats.enqueued. */ public void setEnqueued(Long value) { - set(3, value); + set(2, value); } /** * Getter for public.jobrunr_jobs_stats.enqueued. */ public Long getEnqueued() { - return (Long) get(3); + return (Long) get(2); } /** * Setter for public.jobrunr_jobs_stats.processing. */ public void setProcessing(Long value) { - set(4, value); + set(3, value); } /** * Getter for public.jobrunr_jobs_stats.processing. */ public Long getProcessing() { - return (Long) get(4); + return (Long) get(3); } /** * Setter for public.jobrunr_jobs_stats.failed. */ public void setFailed(Long value) { - set(5, value); + set(4, value); } /** * Getter for public.jobrunr_jobs_stats.failed. */ public Long getFailed() { - return (Long) get(5); + return (Long) get(4); } /** * Setter for public.jobrunr_jobs_stats.succeeded. */ public void setSucceeded(Long value) { - set(6, value); + set(5, value); } /** * Getter for public.jobrunr_jobs_stats.succeeded. */ public Long getSucceeded() { - return (Long) get(6); + return (Long) get(5); } /** * Setter for public.jobrunr_jobs_stats.alltimesucceeded. */ - public void setAlltimesucceeded(Long value) { - set(7, value); + public void setAlltimesucceeded(BigDecimal value) { + set(6, value); } /** * Getter for public.jobrunr_jobs_stats.alltimesucceeded. */ - public Long getAlltimesucceeded() { - return (Long) get(7); + public BigDecimal getAlltimesucceeded() { + return (BigDecimal) get(6); } /** * Setter for public.jobrunr_jobs_stats.deleted. */ public void setDeleted(Long value) { - set(8, value); + set(7, value); } /** * Getter for public.jobrunr_jobs_stats.deleted. */ public Long getDeleted() { - return (Long) get(8); + return (Long) get(7); } /** - * Setter for public.jobrunr_jobs_stats.nbrofbackgroundjobservers. + * Setter for + * public.jobrunr_jobs_stats.nbrofbackgroundjobservers. */ public void setNbrofbackgroundjobservers(Long value) { - set(9, value); + set(8, value); } /** - * Getter for public.jobrunr_jobs_stats.nbrofbackgroundjobservers. + * Getter for + * public.jobrunr_jobs_stats.nbrofbackgroundjobservers. */ public Long getNbrofbackgroundjobservers() { - return (Long) get(9); + return (Long) get(8); } /** * Setter for public.jobrunr_jobs_stats.nbrofrecurringjobs. */ public void setNbrofrecurringjobs(Long value) { - set(10, value); + set(9, value); } /** * Getter for public.jobrunr_jobs_stats.nbrofrecurringjobs. */ public Long getNbrofrecurringjobs() { - return (Long) get(10); + return (Long) get(9); } // ------------------------------------------------------------------------- - // Record11 type implementation + // Record10 type implementation // ------------------------------------------------------------------------- @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); + public Row10 fieldsRow() { + return (Row10) super.fieldsRow(); } @Override - public Row11 valuesRow() { - return (Row11) super.valuesRow(); + public Row10 valuesRow() { + return (Row10) super.valuesRow(); } @Override @@ -194,51 +184,46 @@ public Field field1() { @Override public Field field2() { - return JobrunrJobsStats.JOBRUNR_JOBS_STATS.AWAITING; - } - - @Override - public Field field3() { return JobrunrJobsStats.JOBRUNR_JOBS_STATS.SCHEDULED; } @Override - public Field field4() { + public Field field3() { return JobrunrJobsStats.JOBRUNR_JOBS_STATS.ENQUEUED; } @Override - public Field field5() { + public Field field4() { return JobrunrJobsStats.JOBRUNR_JOBS_STATS.PROCESSING; } @Override - public Field field6() { + public Field field5() { return JobrunrJobsStats.JOBRUNR_JOBS_STATS.FAILED; } @Override - public Field field7() { + public Field field6() { return JobrunrJobsStats.JOBRUNR_JOBS_STATS.SUCCEEDED; } @Override - public Field field8() { + public Field field7() { return JobrunrJobsStats.JOBRUNR_JOBS_STATS.ALLTIMESUCCEEDED; } @Override - public Field field9() { + public Field field8() { return JobrunrJobsStats.JOBRUNR_JOBS_STATS.DELETED; } @Override - public Field field10() { + public Field field9() { return JobrunrJobsStats.JOBRUNR_JOBS_STATS.NBROFBACKGROUNDJOBSERVERS; } @Override - public Field field11() { + public Field field10() { return JobrunrJobsStats.JOBRUNR_JOBS_STATS.NBROFRECURRINGJOBS; } @@ -249,51 +234,46 @@ public Long component1() { @Override public Long component2() { - return getAwaiting(); - } - - @Override - public Long component3() { return getScheduled(); } @Override - public Long component4() { + public Long component3() { return getEnqueued(); } @Override - public Long component5() { + public Long component4() { return getProcessing(); } @Override - public Long component6() { + public Long component5() { return getFailed(); } @Override - public Long component7() { + public Long component6() { return getSucceeded(); } @Override - public Long component8() { + public BigDecimal component7() { return getAlltimesucceeded(); } @Override - public Long component9() { + public Long component8() { return getDeleted(); } @Override - public Long component10() { + public Long component9() { return getNbrofbackgroundjobservers(); } @Override - public Long component11() { + public Long component10() { return getNbrofrecurringjobs(); } @@ -304,51 +284,46 @@ public Long value1() { @Override public Long value2() { - return getAwaiting(); - } - - @Override - public Long value3() { return getScheduled(); } @Override - public Long value4() { + public Long value3() { return getEnqueued(); } @Override - public Long value5() { + public Long value4() { return getProcessing(); } @Override - public Long value6() { + public Long value5() { return getFailed(); } @Override - public Long value7() { + public Long value6() { return getSucceeded(); } @Override - public Long value8() { + public BigDecimal value7() { return getAlltimesucceeded(); } @Override - public Long value9() { + public Long value8() { return getDeleted(); } @Override - public Long value10() { + public Long value9() { return getNbrofbackgroundjobservers(); } @Override - public Long value11() { + public Long value10() { return getNbrofrecurringjobs(); } @@ -360,66 +335,60 @@ public JobrunrJobsStatsRecord value1(Long value) { @Override public JobrunrJobsStatsRecord value2(Long value) { - setAwaiting(value); - return this; - } - - @Override - public JobrunrJobsStatsRecord value3(Long value) { setScheduled(value); return this; } @Override - public JobrunrJobsStatsRecord value4(Long value) { + public JobrunrJobsStatsRecord value3(Long value) { setEnqueued(value); return this; } @Override - public JobrunrJobsStatsRecord value5(Long value) { + public JobrunrJobsStatsRecord value4(Long value) { setProcessing(value); return this; } @Override - public JobrunrJobsStatsRecord value6(Long value) { + public JobrunrJobsStatsRecord value5(Long value) { setFailed(value); return this; } @Override - public JobrunrJobsStatsRecord value7(Long value) { + public JobrunrJobsStatsRecord value6(Long value) { setSucceeded(value); return this; } @Override - public JobrunrJobsStatsRecord value8(Long value) { + public JobrunrJobsStatsRecord value7(BigDecimal value) { setAlltimesucceeded(value); return this; } @Override - public JobrunrJobsStatsRecord value9(Long value) { + public JobrunrJobsStatsRecord value8(Long value) { setDeleted(value); return this; } @Override - public JobrunrJobsStatsRecord value10(Long value) { + public JobrunrJobsStatsRecord value9(Long value) { setNbrofbackgroundjobservers(value); return this; } @Override - public JobrunrJobsStatsRecord value11(Long value) { + public JobrunrJobsStatsRecord value10(Long value) { setNbrofrecurringjobs(value); return this; } @Override - public JobrunrJobsStatsRecord values(Long value1, Long value2, Long value3, Long value4, Long value5, Long value6, Long value7, Long value8, Long value9, Long value10, Long value11) { + public JobrunrJobsStatsRecord values(Long value1, Long value2, Long value3, Long value4, Long value5, Long value6, BigDecimal value7, Long value8, Long value9, Long value10) { value1(value1); value2(value2); value3(value3); @@ -430,7 +399,6 @@ public JobrunrJobsStatsRecord values(Long value1, Long value2, Long value3, Long value8(value8); value9(value9); value10(value10); - value11(value11); return this; } @@ -448,11 +416,10 @@ public JobrunrJobsStatsRecord() { /** * Create a detached, initialised JobrunrJobsStatsRecord */ - public JobrunrJobsStatsRecord(Long total, Long awaiting, Long scheduled, Long enqueued, Long processing, Long failed, Long succeeded, Long alltimesucceeded, Long deleted, Long nbrofbackgroundjobservers, Long nbrofrecurringjobs) { + public JobrunrJobsStatsRecord(Long total, Long scheduled, Long enqueued, Long processing, Long failed, Long succeeded, BigDecimal alltimesucceeded, Long deleted, Long nbrofbackgroundjobservers, Long nbrofrecurringjobs) { super(JobrunrJobsStats.JOBRUNR_JOBS_STATS); setTotal(total); - setAwaiting(awaiting); setScheduled(scheduled); setEnqueued(enqueued); setProcessing(processing); @@ -462,5 +429,6 @@ public JobrunrJobsStatsRecord(Long total, Long awaiting, Long scheduled, Long en setDeleted(deleted); setNbrofbackgroundjobservers(nbrofbackgroundjobservers); setNbrofrecurringjobs(nbrofrecurringjobs); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMetadataRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMetadataRecord.java index ea28532dc..34b9a236d 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMetadataRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMetadataRecord.java @@ -289,5 +289,6 @@ public JobrunrMetadataRecord(String id, String name, String owner, String value, setValue(value); setCreatedat(createdat); setUpdatedat(updatedat); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMigrationsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMigrationsRecord.java index e6ca4038b..c0c798d2a 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMigrationsRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrMigrationsRecord.java @@ -176,5 +176,6 @@ public JobrunrMigrationsRecord(String id, String script, String installedon) { setId(id); setScript(script); setInstalledon(installedon); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrRecurringJobsRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrRecurringJobsRecord.java index a7b29a751..94d4c69aa 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrRecurringJobsRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/JobrunrRecurringJobsRecord.java @@ -7,8 +7,8 @@ import org.eclipse.openvsx.jooq.tables.JobrunrRecurringJobs; import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; +import org.jooq.Record4; +import org.jooq.Row4; import org.jooq.impl.UpdatableRecordImpl; @@ -16,7 +16,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class JobrunrRecurringJobsRecord extends UpdatableRecordImpl implements Record3 { +public class JobrunrRecurringJobsRecord extends UpdatableRecordImpl implements Record4 { private static final long serialVersionUID = 1L; @@ -62,6 +62,20 @@ public String getJobasjson() { return (String) get(2); } + /** + * Setter for public.jobrunr_recurring_jobs.createdat. + */ + public void setCreatedat(Long value) { + set(3, value); + } + + /** + * Getter for public.jobrunr_recurring_jobs.createdat. + */ + public Long getCreatedat() { + return (Long) get(3); + } + // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @@ -72,17 +86,17 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record3 type implementation + // Record4 type implementation // ------------------------------------------------------------------------- @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public Row4 fieldsRow() { + return (Row4) super.fieldsRow(); } @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); + public Row4 valuesRow() { + return (Row4) super.valuesRow(); } @Override @@ -100,6 +114,11 @@ public Field field3() { return JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS.JOBASJSON; } + @Override + public Field field4() { + return JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS.CREATEDAT; + } + @Override public String component1() { return getId(); @@ -115,6 +134,11 @@ public String component3() { return getJobasjson(); } + @Override + public Long component4() { + return getCreatedat(); + } + @Override public String value1() { return getId(); @@ -130,6 +154,11 @@ public String value3() { return getJobasjson(); } + @Override + public Long value4() { + return getCreatedat(); + } + @Override public JobrunrRecurringJobsRecord value1(String value) { setId(value); @@ -149,10 +178,17 @@ public JobrunrRecurringJobsRecord value3(String value) { } @Override - public JobrunrRecurringJobsRecord values(String value1, Integer value2, String value3) { + public JobrunrRecurringJobsRecord value4(Long value) { + setCreatedat(value); + return this; + } + + @Override + public JobrunrRecurringJobsRecord values(String value1, Integer value2, String value3, Long value4) { value1(value1); value2(value2); value3(value3); + value4(value4); return this; } @@ -170,11 +206,13 @@ public JobrunrRecurringJobsRecord() { /** * Create a detached, initialised JobrunrRecurringJobsRecord */ - public JobrunrRecurringJobsRecord(String id, Integer version, String jobasjson) { + public JobrunrRecurringJobsRecord(String id, Integer version, String jobasjson, Long createdat) { super(JobrunrRecurringJobs.JOBRUNR_RECURRING_JOBS); setId(id); setVersion(version); setJobasjson(jobasjson); + setCreatedat(createdat); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/MigrationItemRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/MigrationItemRecord.java index 67a0b5a23..6a3662463 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/MigrationItemRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/MigrationItemRecord.java @@ -213,5 +213,6 @@ public MigrationItemRecord(Long id, String migrationScript, Long entityId, Boole setMigrationScript(migrationScript); setEntityId(entityId); setMigrationScheduled(migrationScheduled); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceMembershipRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceMembershipRecord.java index 3185560ec..144261434 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceMembershipRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceMembershipRecord.java @@ -213,5 +213,6 @@ public NamespaceMembershipRecord(Long id, String role, Long namespace, Long user setRole(role); setNamespace(namespace); setUserData(userData); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceRecord.java index 0ff42e648..3b8084bcc 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceRecord.java @@ -7,8 +7,8 @@ import org.eclipse.openvsx.jooq.tables.Namespace; import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record10; -import org.jooq.Row10; +import org.jooq.Record11; +import org.jooq.Row11; import org.jooq.impl.UpdatableRecordImpl; @@ -16,7 +16,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class NamespaceRecord extends UpdatableRecordImpl implements Record10 { +public class NamespaceRecord extends UpdatableRecordImpl implements Record11 { private static final long serialVersionUID = 1L; @@ -160,6 +160,20 @@ public String getLogoStorageType() { return (String) get(9); } + /** + * Setter for public.namespace.logo_content_type. + */ + public void setLogoContentType(String value) { + set(10, value); + } + + /** + * Getter for public.namespace.logo_content_type. + */ + public String getLogoContentType() { + return (String) get(10); + } + // ------------------------------------------------------------------------- // Primary key information // ------------------------------------------------------------------------- @@ -170,17 +184,17 @@ public Record1 key() { } // ------------------------------------------------------------------------- - // Record10 type implementation + // Record11 type implementation // ------------------------------------------------------------------------- @Override - public Row10 fieldsRow() { - return (Row10) super.fieldsRow(); + public Row11 fieldsRow() { + return (Row11) super.fieldsRow(); } @Override - public Row10 valuesRow() { - return (Row10) super.valuesRow(); + public Row11 valuesRow() { + return (Row11) super.valuesRow(); } @Override @@ -233,6 +247,11 @@ public Field field10() { return Namespace.NAMESPACE.LOGO_STORAGE_TYPE; } + @Override + public Field field11() { + return Namespace.NAMESPACE.LOGO_CONTENT_TYPE; + } + @Override public Long component1() { return getId(); @@ -283,6 +302,11 @@ public String component10() { return getLogoStorageType(); } + @Override + public String component11() { + return getLogoContentType(); + } + @Override public Long value1() { return getId(); @@ -333,6 +357,11 @@ public String value10() { return getLogoStorageType(); } + @Override + public String value11() { + return getLogoContentType(); + } + @Override public NamespaceRecord value1(Long value) { setId(value); @@ -394,7 +423,13 @@ public NamespaceRecord value10(String value) { } @Override - public NamespaceRecord values(Long value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, byte[] value9, String value10) { + public NamespaceRecord value11(String value) { + setLogoContentType(value); + return this; + } + + @Override + public NamespaceRecord values(Long value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, byte[] value9, String value10, String value11) { value1(value1); value2(value2); value3(value3); @@ -405,6 +440,7 @@ public NamespaceRecord values(Long value1, String value2, String value3, String value8(value8); value9(value9); value10(value10); + value11(value11); return this; } @@ -422,7 +458,7 @@ public NamespaceRecord() { /** * Create a detached, initialised NamespaceRecord */ - public NamespaceRecord(Long id, String name, String publicId, String displayName, String description, String website, String supportLink, String logoName, byte[] logoBytes, String logoStorageType) { + public NamespaceRecord(Long id, String name, String publicId, String displayName, String description, String website, String supportLink, String logoName, byte[] logoBytes, String logoStorageType, String logoContentType) { super(Namespace.NAMESPACE); setId(id); @@ -435,5 +471,7 @@ public NamespaceRecord(Long id, String name, String publicId, String displayName setLogoName(logoName); setLogoBytes(logoBytes); setLogoStorageType(logoStorageType); + setLogoContentType(logoContentType); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceSocialLinksRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceSocialLinksRecord.java index 01dc419e8..f2517ba8a 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceSocialLinksRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/NamespaceSocialLinksRecord.java @@ -166,5 +166,6 @@ public NamespaceSocialLinksRecord(Long namespaceId, String provider, String soci setNamespaceId(namespaceId); setProvider(provider); setSocialLink(socialLink); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/PersistedLogRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/PersistedLogRecord.java index e26caf4ff..fa7141319 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/PersistedLogRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/PersistedLogRecord.java @@ -215,5 +215,6 @@ public PersistedLogRecord(Long id, LocalDateTime timestamp, Long userData, Strin setTimestamp(timestamp); setUserData(userData); setMessage(message); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/PersonalAccessTokenRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/PersonalAccessTokenRecord.java index 508d88391..c7d23105c 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/PersonalAccessTokenRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/PersonalAccessTokenRecord.java @@ -326,5 +326,6 @@ public PersonalAccessTokenRecord(Long id, LocalDateTime accessedTimestamp, Boole setDescription(description); setValue(value); setUserData(userData); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ShedlockRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ShedlockRecord.java index 18ee61deb..234c922c2 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ShedlockRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ShedlockRecord.java @@ -215,5 +215,6 @@ public ShedlockRecord(String name, LocalDateTime lockUntil, LocalDateTime locked setLockUntil(lockUntil); setLockedAt(lockedAt); setLockedBy(lockedBy); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SignatureKeyPairRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SignatureKeyPairRecord.java index e41b82c6a..e035b22a7 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SignatureKeyPairRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SignatureKeyPairRecord.java @@ -289,5 +289,6 @@ public SignatureKeyPairRecord(Long id, String publicId, byte[] privateKey, Strin setPublicKeyText(publicKeyText); setCreated(created); setActive(active); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SpringSessionAttributesRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SpringSessionAttributesRecord.java index c1fa13742..d899c7342 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SpringSessionAttributesRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SpringSessionAttributesRecord.java @@ -21,14 +21,16 @@ public class SpringSessionAttributesRecord extends UpdatableRecordImplpublic.spring_session_attributes.session_primary_id. + * Setter for + * public.spring_session_attributes.session_primary_id. */ public void setSessionPrimaryId(String value) { set(0, value); } /** - * Getter for public.spring_session_attributes.session_primary_id. + * Getter for + * public.spring_session_attributes.session_primary_id. */ public String getSessionPrimaryId() { return (String) get(0); @@ -176,5 +178,6 @@ public SpringSessionAttributesRecord(String sessionPrimaryId, String attributeNa setSessionPrimaryId(sessionPrimaryId); setAttributeName(attributeName); setAttributeBytes(attributeBytes); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SpringSessionRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SpringSessionRecord.java index c21baf79f..4024a50e1 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SpringSessionRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/SpringSessionRecord.java @@ -324,5 +324,6 @@ public SpringSessionRecord(String primaryId, String sessionId, Long creationTime setMaxInactiveInterval(maxInactiveInterval); setExpiryTime(expiryTime); setPrincipalName(principalName); + resetChangedOnNotNull(); } } diff --git a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/UserDataRecord.java b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/UserDataRecord.java index bb4f8c8fd..6f849a003 100644 --- a/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/UserDataRecord.java +++ b/server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/UserDataRecord.java @@ -509,5 +509,6 @@ public UserDataRecord(Long id, String avatarUrl, String email, String fullName, setEclipseData(eclipseData); setEclipseToken(eclipseToken); setGithubToken(githubToken); + resetChangedOnNotNull(); } } diff --git a/server/src/main/resources/db/migration/V1_41__FileResource_ContentType.sql b/server/src/main/resources/db/migration/V1_41__FileResource_ContentType.sql new file mode 100644 index 000000000..524d92218 --- /dev/null +++ b/server/src/main/resources/db/migration/V1_41__FileResource_ContentType.sql @@ -0,0 +1,9 @@ +ALTER TABLE file_resource ADD COLUMN content_type CHARACTER VARYING(255); +UPDATE file_resource SET content_type = 'text/plain' WHERE type = 'sha256' OR type = 'signature'; +UPDATE file_resource SET content_type = 'application/zip' WHERE type = 'download'; + +INSERT INTO migration_item(id, migration_script, entity_id, migration_scheduled) +SELECT nextval('hibernate_sequence'), 'V1_41__FileResource_ContentType.sql', ev.id, FALSE +FROM extension_version ev +JOIN extension e ON e.id = ev.extension_id +ORDER BY e.download_count DESC; \ No newline at end of file diff --git a/server/src/main/resources/db/migration/V1_42__Namespace_Logo_ContentType.sql b/server/src/main/resources/db/migration/V1_42__Namespace_Logo_ContentType.sql new file mode 100644 index 000000000..38e169f14 --- /dev/null +++ b/server/src/main/resources/db/migration/V1_42__Namespace_Logo_ContentType.sql @@ -0,0 +1,6 @@ +ALTER TABLE namespace ADD COLUMN logo_content_type CHARACTER VARYING(255); + +INSERT INTO migration_item(id, migration_script, entity_id, migration_scheduled) +SELECT nextval('hibernate_sequence'), 'V1_42__Namespace_Logo_ContentType.sql', n.id, FALSE +FROM namespace n +WHERE n.logo_storage_type IS NOT NULL; \ No newline at end of file diff --git a/server/src/test/java/org/eclipse/openvsx/RegistryAPITest.java b/server/src/test/java/org/eclipse/openvsx/RegistryAPITest.java index dcab83182..2f08caaf7 100644 --- a/server/src/test/java/org/eclipse/openvsx/RegistryAPITest.java +++ b/server/src/test/java/org/eclipse/openvsx/RegistryAPITest.java @@ -1908,12 +1908,14 @@ private ExtensionVersion mockExtension(String targetPlatform, boolean withSignat download.setType(DOWNLOAD); download.setStorageType(STORAGE_DB); download.setName("extension-1.0.0.vsix"); + download.setContentType("application/zip"); var signature = new FileResource(); if(withSignature) { signature.setExtension(extVersion); signature.setType(DOWNLOAD_SIG); signature.setStorageType(STORAGE_DB); signature.setName("extension-1.0.0.sigzip"); + signature.setContentType("application/sigzip"); } Mockito.when(entityManager.merge(download)).thenReturn(download); Mockito.when(repositories.findFilesByType(anyCollection(), anyCollection())).thenAnswer(invocation -> { @@ -1963,6 +1965,7 @@ private FileResource mockReadme(String targetPlatform) { resource.setName("README"); resource.setType(FileResource.README); resource.setContent("Please read me".getBytes()); + resource.setContentType(MediaType.TEXT_PLAIN_VALUE); resource.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(resource)).thenReturn(resource); Mockito.when(repositories.findFileByName(extVersion, "README")) @@ -1979,6 +1982,7 @@ private FileResource mockChangelog() { resource.setName("CHANGELOG"); resource.setType(FileResource.CHANGELOG); resource.setContent("All notable changes is documented here".getBytes()); + resource.setContentType(MediaType.TEXT_PLAIN_VALUE); resource.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(resource)).thenReturn(resource); Mockito.when(repositories.findFileByName(extVersion, "CHANGELOG")) @@ -1995,6 +1999,7 @@ private FileResource mockLicense() { resource.setName("LICENSE"); resource.setType(FileResource.LICENSE); resource.setContent("I never broke the Law! I am the law!".getBytes()); + resource.setContentType(MediaType.TEXT_PLAIN_VALUE); resource.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(resource)).thenReturn(resource); Mockito.when(repositories.findFileByName(extVersion, "LICENSE")) @@ -2008,9 +2013,10 @@ private FileResource mockLatest() { var extVersion = mockExtension(); var resource = new FileResource(); resource.setExtension(extVersion); - resource.setName("DOWNLOAD"); + resource.setName("package.vsix"); resource.setType(FileResource.DOWNLOAD); resource.setContent("latest download".getBytes()); + resource.setContentType("application/zip"); resource.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(resource)).thenReturn(resource); Mockito.when(repositories.findFileByType(extVersion, FileResource.DOWNLOAD)) @@ -2257,6 +2263,13 @@ private byte[] createExtensionPackage(String name, String version, String licens (license == null ? "" : ",\"license\": \"" + license + "\"" ) + "}"; archive.write(packageJson.getBytes()); + archive.putNextEntry(new ZipEntry("[Content_Types].xml")); + var contentTypesXml = "" + + "" + + "" + + "" + + ""; + archive.write(contentTypesXml.getBytes()); archive.closeEntry(); archive.finish(); return bytes.toByteArray(); diff --git a/server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAPITest.java b/server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAPITest.java index a3b2f5d17..2834daed2 100644 --- a/server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAPITest.java +++ b/server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAPITest.java @@ -64,6 +64,7 @@ import org.springframework.data.elasticsearch.core.SearchHitsImpl; import org.springframework.data.elasticsearch.core.TotalHitsRelation; import org.springframework.data.util.Streamable; +import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; import org.springframework.test.web.servlet.MockMvc; @@ -233,6 +234,7 @@ public void testAsset() throws Exception { mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.Manifest")) .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)) .andExpect(content().string("{\"foo\":\"bar\"}")); } @@ -243,6 +245,7 @@ public void testAssetMacOSX() throws Exception { mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}?targetPlatform={target}", "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.Manifest", target)) .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)) .andExpect(content().string("{\"foo\":\"bar\",\"target\":\"darwin-arm64\"}")); } @@ -256,6 +259,15 @@ public void testAssetNotFound() throws Exception { .andExpect(status().isNotFound()); } + @Test + public void testAssetVsixPackage() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Services.VSIXPackage")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, "application/zip")); + } + @Test public void testGetItem() throws Exception { var extension = mockExtension(); @@ -267,14 +279,65 @@ public void testGetItem() throws Exception { } @Test - public void testWebResourceAsset() throws Exception { + public void testDefaultWebResourceAsset() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/resources/data.bin")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_OCTET_STREAM_VALUE)) + .andExpect(content().string("data.bin")); + } + + @Test + public void testPngWebResourceAsset() throws Exception { mockExtensionVersion(); mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/img/logo.png")) .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, MediaType.IMAGE_PNG_VALUE)) .andExpect(content().string("logo.png")); } + @Test + public void testCssWebResourceAsset() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/public/static/css/main.css")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, "text/css")) + .andExpect(content().string(".main { margin: 0 auto; }")); + } + + @Test + public void testChunkCssWebResourceAsset() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/public/static/css/main.9cab4879.chunk.css")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, "text/css")) + .andExpect(content().string(".root { margin: 0 auto; }")); + } + + @Test + public void testJsWebResourceAsset() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/public/static/js/main.js")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, "application/javascript")) + .andExpect(content().string("() => { console.log('main'); }")); + } + + @Test + public void testChunkJsWebResourceAsset() throws Exception { + mockExtensionVersion(); + mockMvc.perform(get("/vscode/asset/{namespace}/{extensionName}/{version}/{assetType}", + "redhat", "vscode-yaml", "0.5.2", "Microsoft.VisualStudio.Code.WebResources/extension/public/static/js/main.34d01954.chunk.js")) + .andExpect(status().isOk()) + .andExpect(header().string(HttpHeaders.CONTENT_TYPE, "application/javascript")) + .andExpect(content().string("() => { console.log('js'); }")); + } + @Test public void testNotWebResourceAsset() throws Exception { mockExtensionVersion(); @@ -359,12 +422,12 @@ public void testBrowseTopDir() throws Exception { Mockito.when(repositories.findActiveExtensionVersionsByVersion(version, extensionName, namespaceName)) .thenReturn(List.of(extVersion)); - var vsixResource = mockFileResource(15, extVersion, "extension.vsixmanifest", RESOURCE, STORAGE_DB, "".getBytes(StandardCharsets.UTF_8)); - var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, "{\"package\":\"json\"}".getBytes(StandardCharsets.UTF_8)); - var readmeResource = mockFileResource(17, extVersion, "extension/README.md", RESOURCE, STORAGE_DB, "README".getBytes(StandardCharsets.UTF_8)); - var changelogResource = mockFileResource(18, extVersion, "extension/CHANGELOG.md", RESOURCE, STORAGE_DB, "CHANGELOG".getBytes(StandardCharsets.UTF_8)); - var licenseResource = mockFileResource(19, extVersion, "extension/LICENSE.txt", RESOURCE, STORAGE_DB, "LICENSE".getBytes(StandardCharsets.UTF_8)); - var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, "ICON128".getBytes(StandardCharsets.UTF_8)); + var vsixResource = mockFileResource(15, extVersion, "extension.vsixmanifest", RESOURCE, STORAGE_DB, "".getBytes(StandardCharsets.UTF_8), "application/xml"); + var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, "{\"package\":\"json\"}".getBytes(StandardCharsets.UTF_8), "application/json"); + var readmeResource = mockFileResource(17, extVersion, "extension/README.md", RESOURCE, STORAGE_DB, "README".getBytes(StandardCharsets.UTF_8), "text/markdown"); + var changelogResource = mockFileResource(18, extVersion, "extension/CHANGELOG.md", RESOURCE, STORAGE_DB, "CHANGELOG".getBytes(StandardCharsets.UTF_8), "text/markdown"); + var licenseResource = mockFileResource(19, extVersion, "extension/LICENSE.txt", RESOURCE, STORAGE_DB, "LICENSE".getBytes(StandardCharsets.UTF_8), "text/plain"); + var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, "ICON128".getBytes(StandardCharsets.UTF_8), "image/png"); Mockito.when(repositories.findResourceFileResources(1L, "")) .thenReturn(List.of(vsixResource, manifestResource, readmeResource, changelogResource, licenseResource, iconResource)); @@ -396,7 +459,7 @@ public void testBrowseVsixManifest() throws Exception { .thenReturn(List.of(extVersion)); var content = "".getBytes(StandardCharsets.UTF_8); - var vsixResource = mockFileResource(15, extVersion, "extension.vsixmanifest", RESOURCE, STORAGE_DB, content); + var vsixResource = mockFileResource(15, extVersion, "extension.vsixmanifest", RESOURCE, STORAGE_DB, content, "application/xml"); Mockito.when(repositories.findResourceFileResources(1L, "extension.vsixmanifest")) .thenReturn(List.of(vsixResource)); @@ -431,7 +494,7 @@ public void testBrowseVsixManifestUniversal() throws Exception { .thenReturn(extVersions); var content = "".getBytes(StandardCharsets.UTF_8); - var vsixResource = mockFileResource(15, extVersions.get(0), "extension.vsixmanifest", RESOURCE, STORAGE_DB, content); + var vsixResource = mockFileResource(15, extVersions.get(0), "extension.vsixmanifest", RESOURCE, STORAGE_DB, content, "application/xml"); Mockito.when(repositories.findResourceFileResources(1L, "extension.vsixmanifest")) .thenReturn(List.of(vsixResource)); @@ -466,7 +529,7 @@ public void testBrowseVsixManifestWindows() throws Exception { .thenReturn(extVersions); var content = "".getBytes(StandardCharsets.UTF_8); - var vsixResource = mockFileResource(15, extVersions.get(2), "extension.vsixmanifest", RESOURCE, STORAGE_DB, content); + var vsixResource = mockFileResource(15, extVersions.get(2), "extension.vsixmanifest", RESOURCE, STORAGE_DB, content, "application/xml"); Mockito.when(repositories.findResourceFileResources(4L, "extension.vsixmanifest")) .thenReturn(List.of(vsixResource)); @@ -495,11 +558,11 @@ public void testBrowseExtensionDir() throws Exception { Mockito.when(repositories.findActiveExtensionVersionsByVersion(version, extensionName, namespaceName)) .thenReturn(List.of(extVersion)); - var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, "{\"package\":\"json\"}".getBytes(StandardCharsets.UTF_8)); - var readmeResource = mockFileResource(17, extVersion, "extension/README.md", RESOURCE, STORAGE_DB, "README".getBytes(StandardCharsets.UTF_8)); - var changelogResource = mockFileResource(18, extVersion, "extension/CHANGELOG.md", RESOURCE, STORAGE_DB, "CHANGELOG".getBytes(StandardCharsets.UTF_8)); - var licenseResource = mockFileResource(19, extVersion, "extension/LICENSE.txt", RESOURCE, STORAGE_DB, "LICENSE".getBytes(StandardCharsets.UTF_8)); - var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, "ICON128".getBytes(StandardCharsets.UTF_8)); + var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, "{\"package\":\"json\"}".getBytes(StandardCharsets.UTF_8), "application/json"); + var readmeResource = mockFileResource(17, extVersion, "extension/README.md", RESOURCE, STORAGE_DB, "README".getBytes(StandardCharsets.UTF_8), "text/markdown"); + var changelogResource = mockFileResource(18, extVersion, "extension/CHANGELOG.md", RESOURCE, STORAGE_DB, "CHANGELOG".getBytes(StandardCharsets.UTF_8), "text/markdown"); + var licenseResource = mockFileResource(19, extVersion, "extension/LICENSE.txt", RESOURCE, STORAGE_DB, "LICENSE".getBytes(StandardCharsets.UTF_8), "text/plain"); + var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, "ICON128".getBytes(StandardCharsets.UTF_8), "image/png"); Mockito.when(repositories.findResourceFileResources(1L, "extension")) .thenReturn(List.of(manifestResource, readmeResource, changelogResource, licenseResource, iconResource)); @@ -535,7 +598,7 @@ public void testBrowsePackageJson() throws Exception { .thenReturn(List.of(extVersion)); var content = "{\"package\":\"json\"}".getBytes(StandardCharsets.UTF_8); - var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, content); + var manifestResource = mockFileResource(16, extVersion, "extension/package.json", RESOURCE, STORAGE_DB, content, "application/json"); Mockito.when(repositories.findResourceFileResources(1L, "extension/package.json")) .thenReturn(List.of(manifestResource)); @@ -564,7 +627,7 @@ public void testBrowseImagesDir() throws Exception { .thenReturn(List.of(extVersion)); var content = "ICON128".getBytes(StandardCharsets.UTF_8); - var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, content); + var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, content, "image/png"); Mockito.when(repositories.findResourceFileResources(1L, "extension/images")) .thenReturn(List.of(iconResource)); @@ -594,7 +657,7 @@ public void testBrowseIcon() throws Exception { .thenReturn(List.of(extVersion)); var content = "ICON128".getBytes(StandardCharsets.UTF_8); - var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, content); + var iconResource = mockFileResource(20, extVersion, "extension/images/icon128.png", RESOURCE, STORAGE_DB, content, "image/png"); Mockito.when(repositories.findResourceFileResources(1L, "extension/images/icon128.png")) .thenReturn(List.of(iconResource)); @@ -764,10 +827,11 @@ private FileResource mockFileResource(long id, ExtensionVersion extVersion, Stri return resource; } - private FileResource mockFileResource(long id, ExtensionVersion extVersion, String name, String type, String storageType, byte[] content) { + private FileResource mockFileResource(long id, ExtensionVersion extVersion, String name, String type, String storageType, byte[] content, String contentType) { var resource = mockFileResource(id, extVersion, name, type); resource.setStorageType(storageType); resource.setContent(content); + resource.setContentType(contentType); return resource; } @@ -790,6 +854,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json extension.setAverageRating(3.0); extension.setNamespace(namespace); var extVersion = new ExtensionVersion(); + extVersion.setExtension(extension); extension.getVersions().add(extVersion); extVersion.setTargetPlatform(targetPlatform); extVersion.setVersion("0.5.2"); @@ -816,6 +881,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json extensionFile.setExtension(extVersion); extensionFile.setName("redhat.vscode-yaml-0.5.2.vsix"); extensionFile.setType(FileResource.DOWNLOAD); + extensionFile.setContentType("application/zip"); extensionFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(extensionFile)).thenReturn(extensionFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.DOWNLOAD)) @@ -829,6 +895,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json if(!targetPlatform.equals(TargetPlatform.NAME_UNIVERSAL)) manifestContent.put("target", targetPlatform); manifestFile.setContent(new ObjectMapper().writeValueAsBytes(manifestContent)); + manifestFile.setContentType(MediaType.APPLICATION_JSON_VALUE); manifestFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(manifestFile)).thenReturn(manifestFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.MANIFEST)) @@ -837,6 +904,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json readmeFile.setExtension(extVersion); readmeFile.setName("README.md"); readmeFile.setType(FileResource.README); + readmeFile.setContentType("text/markdown"); readmeFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(readmeFile)).thenReturn(readmeFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.README)) @@ -845,6 +913,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json changelogFile.setExtension(extVersion); changelogFile.setName("CHANGELOG.md"); changelogFile.setType(FileResource.CHANGELOG); + changelogFile.setContentType("text/markdown"); changelogFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(changelogFile)).thenReturn(changelogFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.CHANGELOG)) @@ -853,6 +922,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json licenseFile.setExtension(extVersion); licenseFile.setName("LICENSE.txt"); licenseFile.setType(FileResource.LICENSE); + licenseFile.setContentType(MediaType.TEXT_PLAIN_VALUE); licenseFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(licenseFile)).thenReturn(licenseFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.LICENSE)) @@ -861,10 +931,29 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json iconFile.setExtension(extVersion); iconFile.setName("icon128.png"); iconFile.setType(FileResource.ICON); + iconFile.setContentType(MediaType.IMAGE_PNG_VALUE); iconFile.setStorageType(FileResource.STORAGE_DB); Mockito.when(entityManager.merge(iconFile)).thenReturn(iconFile); Mockito.when(repositories.findFileByType(extVersion, FileResource.ICON)) .thenReturn(iconFile); + var binWebResourceFile = new FileResource(); + binWebResourceFile.setExtension(extVersion); + binWebResourceFile.setName("extension/resources/data.bin"); + binWebResourceFile.setType(FileResource.RESOURCE); + binWebResourceFile.setStorageType(STORAGE_DB); + binWebResourceFile.setContent("data.bin".getBytes()); + binWebResourceFile.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); + Mockito.when(entityManager.merge(binWebResourceFile)).thenReturn(binWebResourceFile); + Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/resources/data.bin")) + .thenReturn(binWebResourceFile); + var pngWebResourceFile = new FileResource(); + pngWebResourceFile.setExtension(extVersion); + pngWebResourceFile.setName("extension/img/logo.png"); + pngWebResourceFile.setType(FileResource.RESOURCE); + pngWebResourceFile.setStorageType(STORAGE_DB); + pngWebResourceFile.setContent("logo.png".getBytes()); + pngWebResourceFile.setContentType(MediaType.IMAGE_PNG_VALUE); + Mockito.when(entityManager.merge(pngWebResourceFile)).thenReturn(pngWebResourceFile); var vsixManifestFile = new FileResource(); vsixManifestFile.setExtension(extVersion); vsixManifestFile.setName("extension.vsixmanifest"); @@ -889,7 +978,47 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json webResourceFile.setContent("logo.png".getBytes()); Mockito.when(entityManager.merge(webResourceFile)).thenReturn(webResourceFile); Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/img/logo.png")) - .thenReturn(webResourceFile); + .thenReturn(pngWebResourceFile); + var jsWebResourceFile = new FileResource(); + jsWebResourceFile.setExtension(extVersion); + jsWebResourceFile.setName("extension/public/static/js/main.js"); + jsWebResourceFile.setType(FileResource.RESOURCE); + jsWebResourceFile.setStorageType(STORAGE_DB); + jsWebResourceFile.setContent("() => { console.log('main'); }".getBytes()); + jsWebResourceFile.setContentType("application/javascript"); + Mockito.when(entityManager.merge(jsWebResourceFile)).thenReturn(jsWebResourceFile); + Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/public/static/js/main.js")) + .thenReturn(jsWebResourceFile); + var jsChunkWebResourceFile = new FileResource(); + jsChunkWebResourceFile.setExtension(extVersion); + jsChunkWebResourceFile.setName("extension/public/static/js/main.34d01954.chunk.js"); + jsChunkWebResourceFile.setType(FileResource.RESOURCE); + jsChunkWebResourceFile.setStorageType(STORAGE_DB); + jsChunkWebResourceFile.setContent("() => { console.log('js'); }".getBytes()); + jsChunkWebResourceFile.setContentType("application/javascript"); + Mockito.when(entityManager.merge(jsChunkWebResourceFile)).thenReturn(jsChunkWebResourceFile); + Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/public/static/js/main.34d01954.chunk.js")) + .thenReturn(jsChunkWebResourceFile); + var cssWebResourceFile = new FileResource(); + cssWebResourceFile.setExtension(extVersion); + cssWebResourceFile.setName("extension/public/static/css/main.css"); + cssWebResourceFile.setType(FileResource.RESOURCE); + cssWebResourceFile.setStorageType(STORAGE_DB); + cssWebResourceFile.setContent(".main { margin: 0 auto; }".getBytes()); + cssWebResourceFile.setContentType("text/css"); + Mockito.when(entityManager.merge(cssWebResourceFile)).thenReturn(cssWebResourceFile); + Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/public/static/css/main.css")) + .thenReturn(cssWebResourceFile); + var cssChunkWebResourceFile = new FileResource(); + cssChunkWebResourceFile.setExtension(extVersion); + cssChunkWebResourceFile.setName("extension/public/static/css/main.9cab4879.chunk.css"); + cssChunkWebResourceFile.setType(FileResource.RESOURCE); + cssChunkWebResourceFile.setStorageType(STORAGE_DB); + cssChunkWebResourceFile.setContent(".root { margin: 0 auto; }".getBytes()); + cssChunkWebResourceFile.setContentType("text/css"); + Mockito.when(entityManager.merge(cssChunkWebResourceFile)).thenReturn(cssChunkWebResourceFile); + Mockito.when(repositories.findFileByTypeAndName(extVersion, FileResource.RESOURCE, "extension/public/static/css/main.9cab4879.chunk.css")) + .thenReturn(cssChunkWebResourceFile); Mockito.when(repositories.findFilesByType(anyCollection(), anyCollection())).thenAnswer(invocation -> { Collection extVersions = invocation.getArgument(0); var types = invocation.getArgument(1); @@ -902,7 +1031,7 @@ private ExtensionVersion mockExtensionVersion(String targetPlatform) throws Json return extVersion; } - private String file(String name) throws UnsupportedEncodingException, IOException { + private String file(String name) throws IOException { try (var stream = getClass().getResourceAsStream(name)) { return CharStreams.toString(new InputStreamReader(stream, "UTF-8")); } diff --git a/server/src/test/java/org/eclipse/openvsx/repositories/RepositoryServiceSmokeTest.java b/server/src/test/java/org/eclipse/openvsx/repositories/RepositoryServiceSmokeTest.java index ea789840e..4c77207ed 100644 --- a/server/src/test/java/org/eclipse/openvsx/repositories/RepositoryServiceSmokeTest.java +++ b/server/src/test/java/org/eclipse/openvsx/repositories/RepositoryServiceSmokeTest.java @@ -151,6 +151,8 @@ void testExecuteQueries() { () -> repositories.findNotMigratedVsixManifests(), () -> repositories.findNotMigratedTargetPlatforms(), () -> repositories.findNotMigratedSha256Checksums(), + () -> repositories.findNotMigratedFileResourceContentTypes(), + () -> repositories.findNotMigratedNamespaceLogoContentTypes(), () -> repositories.topMostActivePublishingUsers(NOW, 1), () -> repositories.topNamespaceExtensions(NOW, 1), () -> repositories.topNamespaceExtensionVersions(NOW, 1),