热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.hibernate.boot.model.naming.Identifier.isQuoted()方法的使用及代码示例

本文整理了Java中org.hibernate.boot.model.naming.Identifier.isQuoted()方法的一些代码示例,展示了Id

本文整理了Java中org.hibernate.boot.model.naming.Identifier.isQuoted()方法的一些代码示例,展示了Identifier.isQuoted()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Identifier.isQuoted()方法的具体详情如下:
包路径:org.hibernate.boot.model.naming.Identifier
类名称:Identifier
方法名:isQuoted

Identifier.isQuoted介绍

[英]Is this a quoted identifier>
[中]这是一个带引号的标识符>

代码示例

代码示例来源:origin: hibernate/hibernate-orm

public boolean isCatalogQuoted() {
return catalog != null && catalog.isQuoted();
}

代码示例来源:origin: hibernate/hibernate-orm

public boolean isQuoted() {
return name.isQuoted();
}

代码示例来源:origin: hibernate/hibernate-orm

public boolean isSchemaQuoted() {
return schema != null && schema.isQuoted();
}

代码示例来源:origin: hibernate/hibernate-orm

private void bindLogicalToPhysical(Identifier logicalName, String physicalName) throws DuplicateMappingException {
final String existingPhysicalNameMapping = logicalToPhysical.put( logicalName, physicalName );
if ( existingPhysicalNameMapping != null ) {
final boolean areSame = logicalName.isQuoted()
? physicalName.equals( existingPhysicalNameMapping )
: physicalName.equalsIgnoreCase( existingPhysicalNameMapping );
if ( !areSame ) {
throw new DuplicateMappingException(
String.format(
Locale.ENGLISH,
"Table [%s] contains logical column name [%s] referring to multiple physical " +
"column names: [%s], [%s]",
tableName,
logicalName,
existingPhysicalNameMapping,
physicalName
),
DuplicateMappingException.Type.COLUMN_BINDING,
tableName + "." + logicalName
);
}
}
}

代码示例来源:origin: org.springframework.boot/spring-boot

private Identifier apply(Identifier name, JdbcEnvironment jdbcEnvironment) {
if (name == null) {
return null;
}
StringBuilder builder = new StringBuilder(name.getText().replace('.', '_'));
for (int i = 1; i if (isUnderscoreRequired(builder.charAt(i - 1), builder.charAt(i),
builder.charAt(i + 1))) {
builder.insert(i++, '_');
}
}
return getIdentifier(builder.toString(), name.isQuoted(), jdbcEnvironment);
}

代码示例来源:origin: hibernate/hibernate-orm

public static Identifier quote(Identifier identifier) {
return identifier.isQuoted()
? identifier
: Identifier.toIdentifier( identifier.getText(), true );
}

代码示例来源:origin: hibernate/hibernate-orm

public void setQuoted(boolean quoted) {
if ( quoted == name.isQuoted() ) {
return;
}
this.name = new Identifier( name.getText(), quoted );
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public Identifier normalizeQuoting(Identifier identifier) {
Identifier normalizedIdentifier = this.helper.normalizeQuoting( identifier );
if ( normalizedIdentifier == null ) {
return null;
}
// need to quote names containing special characters like ':'
if ( !normalizedIdentifier.isQuoted() && !normalizedIdentifier.getText().matches( "\\w+" ) ) {
normalizedIdentifier = Identifier.quote( normalizedIdentifier );
}
return normalizedIdentifier;
}

代码示例来源:origin: hibernate/hibernate-orm

private String[] quoteTypeIfNecessary(org.hibernate.mapping.Table table, String[] strings, String prefix) {
if ( table.getNameIdentifier() == null || table.getNameIdentifier().isQuoted()
|| !"type".equals( table.getNameIdentifier().getText().toLowerCase() ) ) {
return strings;
}
Pattern createTableTypePattern = Pattern.compile( "(" + prefix + "\\s+)(" + table.getNameIdentifier().getText() + ")(.+)" );
Pattern commentOnTableTypePattern= Pattern.compile( "(comment\\s+on\\s+table\\s+)(" + table.getNameIdentifier().getText() + ")(.+)" );
for ( int i = 0; i Matcher createTableTypeMatcher = createTableTypePattern.matcher( strings[i] );
Matcher commentOnTableTypeMatcher= commentOnTableTypePattern.matcher( strings[i] );
if ( createTableTypeMatcher.matches() ) {
strings[i] = createTableTypeMatcher.group( 1 ) + "\"TYPE\"" + createTableTypeMatcher.group( 3 );
}
if ( commentOnTableTypeMatcher.matches() ) {
strings[i] = commentOnTableTypeMatcher.group( 1 ) + "\"TYPE\"" + commentOnTableTypeMatcher.group( 3 );
}
}
return strings;
}
};

代码示例来源:origin: hibernate/hibernate-orm

/**
* Constructs an identifier instance.
*
* @param text The identifier text.
* @param quoted Is this a quoted identifier?
*/
public Identifier(String text, boolean quoted) {
if ( StringHelper.isEmpty( text ) ) {
throw new IllegalIdentifierException( "Identifier text cannot be null" );
}
if ( isQuoted( text ) ) {
throw new IllegalIdentifierException( "Identifier text should not contain quote markers (` or \")" );
}
this.text = text;
this.isQuoted = quoted;
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public Identifier toPhysicalColumnName(
Identifier name, JdbcEnvironment context) {
return new Identifier( name.getText().toUpperCase(), name.isQuoted() );
}
} )

代码示例来源:origin: hibernate/hibernate-orm

@Override
public Identifier toPhysicalSequenceName(Identifier name, JdbcEnvironment jdbcEnvironment) {
final LinkedList parts = splitAndReplace( name.getText() );
// Acme Corp says all sequences should end with _seq
if ( !"seq".equalsIgnoreCase( parts.getLast() ) ) {
parts.add( "seq" );
}
return jdbcEnvironment.getIdentifierHelper().toIdentifier(
join( parts ),
name.isQuoted()
);
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public Identifier toPhysicalColumnName(Identifier name, JdbcEnvironment jdbcEnvironment) {
if ( name.getText().equals("DTYPE") ) {
return name;
}
return Identifier.toIdentifier(makeCleanIdentifier("c_" + name.getText()), name.isQuoted());
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public Identifier toPhysicalTableName(Identifier name, JdbcEnvironment jdbcEnvironment) {
return Identifier.toIdentifier(makeCleanIdentifier("tbl_" + name.getText()), name.isQuoted());
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public Identifier determineCollectionTableName(ImplicitCollectionTableNameSource source) {
Identifier identifier = toIdentifier(
source.getOwningPhysicalTableName().getText() + "_" + transformAttributePath( source.getOwningAttributePath() ),
source.getBuildingContext()
);
if ( source.getOwningPhysicalTableName().isQuoted() ) {
identifier = Identifier.quote( identifier );
}
return identifier;
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public Identifier toPhysicalTableName(Identifier name, JdbcEnvironment jdbcEnvironment) {
final List parts = splitAndReplace( name.getText() );
return jdbcEnvironment.getIdentifierHelper().toIdentifier(
join( parts ),
name.isQuoted()
);
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public Identifier toPhysicalColumnName(Identifier name, JdbcEnvironment jdbcEnvironment) {
final List parts = splitAndReplace( name.getText() );
return jdbcEnvironment.getIdentifierHelper().toIdentifier(
join( parts ),
name.isQuoted()
);
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public Identifier normalizeQuoting(Identifier identifier) {
log.tracef( "Normalizing identifier quoting [%s]", identifier );
if ( identifier == null ) {
return null;
}
if ( identifier.isQuoted() ) {
return identifier;
}
if ( globallyQuoteIdentifiers ) {
log.tracef( "Forcing identifier [%s] to quoted for global quoting", identifier );
return Identifier.toIdentifier( identifier.getText(), true );
}
if ( autoQuoteKeywords && isReservedWord( identifier.getText() ) ) {
log.tracef( "Forcing identifier [%s] to quoted as recognized reserved word", identifier );
return Identifier.toIdentifier( identifier.getText(), true );
}
return identifier;
}

代码示例来源:origin: hibernate/hibernate-orm

@Test
public void testAutoQuotingDisabled() {
ServiceRegistry sr = ServiceRegistryTestingImpl.forUnitTesting(
Collections.singletonMap(
AvailableSettings.KEYWORD_AUTO_QUOTING_ENABLED,
// true is the default, but to be sure...
true
)
);
Identifier identifier = sr.getService( JdbcEnvironment.class ).getIdentifierHelper().toIdentifier( "select" );
assertTrue( identifier.isQuoted() );
StandardServiceRegistryBuilder.destroy( sr );
sr = ServiceRegistryTestingImpl.forUnitTesting(
Collections.singletonMap(
AvailableSettings.KEYWORD_AUTO_QUOTING_ENABLED,
false
)
);
identifier = sr.getService( JdbcEnvironment.class ).getIdentifierHelper().toIdentifier( "select" );
assertFalse( identifier.isQuoted() );
StandardServiceRegistryBuilder.destroy( sr );
}
}

代码示例来源:origin: hibernate/hibernate-orm

@Test
@TestForIssue( jiraKey = "HHH_9768" )
public void testAnsiSqlKeyword() {
// END is ANSI SQL keyword
JdbcEnvironment jdbcEnvirOnment= serviceRegistry.getService( JdbcEnvironment.class );
assertTrue( jdbcEnvironment.getIdentifierHelper().isReservedWord( "end" ) );
assertTrue( jdbcEnvironment.getIdentifierHelper().isReservedWord( "END" ) );
Identifier identifier = jdbcEnvironment.getIdentifierHelper().toIdentifier( "end" );
assertTrue( identifier.isQuoted() );
}
}

推荐阅读
  • 标题: ... [详细]
  • 先看官方文档TheJavaTutorialshavebeenwrittenforJDK8.Examplesandpracticesdescribedinthispagedontta ... [详细]
  • 本文介绍了Oracle存储过程的基本语法和写法示例,同时还介绍了已命名的系统异常的产生原因。 ... [详细]
  • 使用圣杯布局模式实现网站首页的内容布局
    本文介绍了使用圣杯布局模式实现网站首页的内容布局的方法,包括HTML部分代码和实例。同时还提供了公司新闻、最新产品、关于我们、联系我们等页面的布局示例。商品展示区包括了车里子和农家生态土鸡蛋等产品的价格信息。 ... [详细]
  • 本文整理了Java中org.apache.solr.common.SolrDocument.setField()方法的一些代码示例,展示了SolrDocum ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
  • Oracle seg,V$TEMPSEG_USAGE与Oracle排序的关系及使用方法
    本文介绍了Oracle seg,V$TEMPSEG_USAGE与Oracle排序之间的关系,V$TEMPSEG_USAGE是V_$SORT_USAGE的同义词,通过查询dba_objects和dba_synonyms视图可以了解到它们的详细信息。同时,还探讨了V$TEMPSEG_USAGE的使用方法。 ... [详细]
  • Python爬虫中使用正则表达式的方法和注意事项
    本文介绍了在Python爬虫中使用正则表达式的方法和注意事项。首先解释了爬虫的四个主要步骤,并强调了正则表达式在数据处理中的重要性。然后详细介绍了正则表达式的概念和用法,包括检索、替换和过滤文本的功能。同时提到了re模块是Python内置的用于处理正则表达式的模块,并给出了使用正则表达式时需要注意的特殊字符转义和原始字符串的用法。通过本文的学习,读者可以掌握在Python爬虫中使用正则表达式的技巧和方法。 ... [详细]
  • 【shell】网络处理:判断IP是否在网段、两个ip是否同网段、IP地址范围、网段包含关系
    本文介绍了使用shell脚本判断IP是否在同一网段、判断IP地址是否在某个范围内、计算IP地址范围、判断网段之间的包含关系的方法和原理。通过对IP和掩码进行与计算,可以判断两个IP是否在同一网段。同时,还提供了一段用于验证IP地址的正则表达式和判断特殊IP地址的方法。 ... [详细]
  • IOS开发之短信发送与拨打电话的方法详解
    本文详细介绍了在IOS开发中实现短信发送和拨打电话的两种方式,一种是使用系统底层发送,虽然无法自定义短信内容和返回原应用,但是简单方便;另一种是使用第三方框架发送,需要导入MessageUI头文件,并遵守MFMessageComposeViewControllerDelegate协议,可以实现自定义短信内容和返回原应用的功能。 ... [详细]
  • Postgresql备份和恢复的方法及命令行操作步骤
    本文介绍了使用Postgresql进行备份和恢复的方法及命令行操作步骤。通过使用pg_dump命令进行备份,pg_restore命令进行恢复,并设置-h localhost选项,可以完成数据的备份和恢复操作。此外,本文还提供了参考链接以获取更多详细信息。 ... [详细]
  • 十大经典排序算法动图演示+Python实现
    本文介绍了十大经典排序算法的原理、演示和Python实现。排序算法分为内部排序和外部排序,常见的内部排序算法有插入排序、希尔排序、选择排序、冒泡排序、归并排序、快速排序、堆排序、基数排序等。文章还解释了时间复杂度和稳定性的概念,并提供了相关的名词解释。 ... [详细]
  • 本文整理了Java中com.evernote.android.job.JobRequest.getTransientExtras()方法的一些代码示例,展示了 ... [详细]
author-avatar
zhaojiapin_313
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有