org.hibernate.Criteria.isReadOnly()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(115)

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

Criteria.isReadOnly介绍

[英]Should entities and proxies loaded by this Criteria be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context is returned instead.
[中]是否应将此条件加载的实体和代理置于只读模式?如果只读/可修改设置未初始化,则返回持久性上下文的默认只读/可修改设置。

代码示例

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

Criteria criteria = s.createCriteria( Student.class ).setReadOnly( true );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertFalse( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
assertTrue( s.isReadOnly( gavin ) );
assertFalse( s.isReadOnly( coursePreferred ) );

代码示例来源:origin: TGAC/miso-lims

@Override
public boolean isReadOnly() {
 return backingCriteria.isReadOnly();
}

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

assertFalse( s.isDefaultReadOnly() );
assertFalse( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
criteria.setReadOnly( false );
assertTrue( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertFalse( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
assertFalse( s.isReadOnly( gavin ) );
assertFalse( Hibernate.isInitialized( gavin.getPreferredCourse() ) );

代码示例来源:origin: ezbz/projectx

@Override
public boolean isReadOnly() {
 return criteria.isReadOnly();
}

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

assertTrue( s.isDefaultReadOnly() );
assertFalse( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
criteria.setReadOnly( true );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertTrue( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
assertTrue( s.isReadOnly( gavin ) );
assertFalse( Hibernate.isInitialized( gavin.getPreferredCourse() ) );

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

Criteria criteria = s.createCriteria( Student.class ).setReadOnly( false );
assertTrue( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertFalse( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
assertFalse( s.isReadOnly( gavin ) );
assertTrue( s.isReadOnly( coursePreferred ) );

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

Criteria criteria = s.createCriteria( Student.class ).setReadOnly( true );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertFalse( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
assertTrue( s.isReadOnly( gavin ) );
assertTrue( Hibernate.isInitialized( coursePreferred ) );

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

assertTrue( s.isDefaultReadOnly() );
assertFalse( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
criteria.setReadOnly( false );
assertTrue( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertTrue( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
assertFalse( s.isReadOnly( gavin ) );
assertFalse( Hibernate.isInitialized( gavin.getPreferredCourse() ) );

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

Criteria criteria = s.createCriteria( Student.class ).setReadOnly( false );
assertTrue( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertFalse( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
assertFalse( s.isReadOnly( gavin ) );
assertFalse( Hibernate.isInitialized( coursePreferred ) );

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

assertTrue( s.isDefaultReadOnly() );
assertFalse( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertTrue( s.isDefaultReadOnly() );
assertFalse( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
assertTrue( s.isReadOnly( gavin ) );
assertFalse( Hibernate.isInitialized( gavin.getPreferredCourse() ) );

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

assertFalse( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertFalse( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
assertTrue( s.isReadOnly( gavin ) );
assertFalse( Hibernate.isInitialized( gavin.getPreferredCourse() ) );

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

Criteria criteria = s.createCriteria( Student.class ).setReadOnly( true );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertFalse( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertTrue( criteria.isReadOnly() );
assertTrue( s.isReadOnly( gavin ) );
assertFalse( Hibernate.isInitialized( coursePreferred ) );

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

Criteria criteria = s.createCriteria( Student.class ).setReadOnly( false );
assertTrue( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertFalse( s.isDefaultReadOnly() );
assertTrue( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
assertFalse( s.isReadOnly( gavin ) );
assertTrue( Hibernate.isInitialized( coursePreferred ) );

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

assertFalse( s.isDefaultReadOnly() );
assertFalse( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
gavin = ( Student ) criteria.uniqueResult();
assertFalse( s.isDefaultReadOnly() );
assertFalse( criteria.isReadOnlyInitialized() );
assertFalse( criteria.isReadOnly() );
assertFalse( s.isReadOnly( gavin ) );
assertFalse( Hibernate.isInitialized( gavin.getPreferredCourse() ) );

相关文章