ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/engine/Comment.java

Path
ttomcat-1778514358873.zip-extract/_dependencies/maven/com.h2database_h2-2.2.220/org/h2/engine/Comment.java
Status
scanned
Type
file
Name
Comment.java
Extension
.java
Programming language
Java
Mime type
text/x-java
File type
Java source, ASCII text
Tag

      
    
Rootfs path

      
    
Size
2997 (2.9 KB)
MD5
0a03991a56bdb53e57dd19ae72b06901
SHA1
dce5501897a7f57ab506cbdcbca3facddc2d02c8
SHA256
12b22a2f827043bc9f9bd17dfac3c6c5030c1e36582d0b98949206159cf72316
SHA512

      
    
SHA1_git
0d066fd06c8f5a5151f284782db6b9195738d000
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
Comment.java | 2.9 KB |

/* * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, * and the EPL 1.0 (https://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.engine; import org.h2.message.DbException; import org.h2.message.Trace; import org.h2.util.StringUtils; /** * Represents a database object comment. */ public final class Comment extends DbObject { private final int objectType; private final String quotedObjectName; private String commentText; public Comment(Database database, int id, DbObject obj) { super(database, id, getKey(obj), Trace.DATABASE); this.objectType = obj.getType(); this.quotedObjectName = obj.getSQL(DEFAULT_SQL_FLAGS); } private static String getTypeName(int type) { switch (type) { case DbObject.CONSTANT: return "CONSTANT"; case DbObject.CONSTRAINT: return "CONSTRAINT"; case DbObject.FUNCTION_ALIAS: return "ALIAS"; case DbObject.INDEX: return "INDEX"; case DbObject.ROLE: return "ROLE"; case DbObject.SCHEMA: return "SCHEMA"; case DbObject.SEQUENCE: return "SEQUENCE"; case DbObject.TABLE_OR_VIEW: return "TABLE"; case DbObject.TRIGGER: return "TRIGGER"; case DbObject.USER: return "USER"; case DbObject.DOMAIN: return "DOMAIN"; default: // not supported by parser, but required when trying to find a // comment return "type" + type; } } @Override public String getCreateSQL() { StringBuilder buff = new StringBuilder("COMMENT ON "); buff.append(getTypeName(objectType)).append(' '). append(quotedObjectName).append(" IS "); if (commentText == null) { buff.append("NULL"); } else { StringUtils.quoteStringSQL(buff, commentText); } return buff.toString(); } @Override public int getType() { return DbObject.COMMENT; } @Override public void removeChildrenAndResources(SessionLocal session) { database.removeMeta(session, getId()); } @Override public void checkRename() { throw DbException.getInternalError(); } /** * Get the comment key name for the given database object. This key name is * used internally to associate the comment to the object. * * @param obj the object * @return the key name */ static String getKey(DbObject obj) { StringBuilder builder = new StringBuilder(getTypeName(obj.getType())).append(' '); obj.getSQL(builder, DEFAULT_SQL_FLAGS); return builder.toString(); } /** * Set the comment text. * * @param comment the text */ public void setCommentText(String comment) { this.commentText = comment; } }
Detected license expression

      
    
Detected license expression (SPDX)

      
    
Percentage of license text
3.75
Copyrights
- end_line: 2
  copyright: Copyright 2004-2023 H2 Group. Multiple-Licensed
  start_line: 2
Holders
- holder: H2 Group. Multiple-Licensed
  end_line: 2
  start_line: 2
Authors

      
    
License expression License clue details
(mpl-2.0 OR epl-1.0) AND proprietary-license {'score': 20.37, 'matcher': '3-seq', 'end_line': 3, 'rule_url': 'https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/mpl-2.0_or_epl-1.0_and_proprietary-license_2.RULE', 'from_file': None, 'start_line': 2, 'matched_text': ' * Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0,\n * and the EPL 1.0 (https://h2database.com/html/license.html).', 'match_coverage': 20.37, 'matched_length': 11, 'rule_relevance': 100, 'rule_identifier': 'mpl-2.0_or_epl-1.0_and_proprietary-license_2.RULE', 'license_expression': '(mpl-2.0 OR epl-1.0) AND proprietary-license', 'license_expression_spdx': '(MPL-2.0 OR EPL-1.0) AND LicenseRef-scancode-proprietary-license'}
URL Start line End line
https://h2database.com/html/license.html 3 3
Package URL License Primary language
pkg:osgi/com.h2database.source@2.2.220