@Override public boolean isVersioned() { return collectionDescriptor.getOwner().isVersioned(); }
public boolean isVersioned() { return getSuperclass().isVersioned(); } public Property getVersion() {
@SuppressWarnings("unchecked") public EntityTypeImpl( Class javaType, IdentifiableTypeDescriptor<? super J> superType, PersistentClass persistentClass, SessionFactoryImplementor sessionFactory) { super( javaType, persistentClass.getEntityName(), superType, persistentClass.getDeclaredIdentifierMapper() != null || ( superType != null && superType.hasIdClass() ), persistentClass.hasIdentifierProperty(), persistentClass.isVersioned(), sessionFactory ); this.jpaEntityName = persistentClass.getJpaEntityName(); }
@SuppressWarnings("UnusedReturnValue") public Builder addEntityConfig(PersistentClass bootEntityDescriptor, AccessType accessType) { if ( entityConfigsByRootName == null ) { entityConfigsByRootName = new HashMap<>(); } // todo (5.3) : this is another place where having `BootstrapContext` / `TypeConfiguration` helps // would allow us to delay the attempt to resolve the comparator (usual timing issues wrt Type resolution) final NavigableRole rootEntityName = new NavigableRole( bootEntityDescriptor.getRootClass().getEntityName() ); final EntityDataCachingConfigImpl entityDataCachingConfig = entityConfigsByRootName.computeIfAbsent( rootEntityName, x -> new EntityDataCachingConfigImpl( rootEntityName, bootEntityDescriptor.isVersioned() ? (Supplier<Comparator>) () -> ( (VersionType) bootEntityDescriptor.getVersion().getType() ).getComparator() : null, bootEntityDescriptor.isMutable(), accessType ) ); if ( bootEntityDescriptor == bootEntityDescriptor.getRootClass() ) { entityDataCachingConfig.addCachedType( rootEntityName ); } else { entityDataCachingConfig.addCachedType( new NavigableRole( bootEntityDescriptor.getEntityName() ) ); } return this; }
if ( persistentClass.isVersioned() ) { versionColumnName = ( (Column) persistentClass.getVersion().getColumnIterator().next() ).getQuotedName( dialect );
if ( safeMapping.isVersioned() && property == safeMapping.getVersion() ) {
); versioned = persistentClass.isVersioned();
public boolean hasVersionProperty() { return clazz.isVersioned() && clazz instanceof RootClass; }
public boolean hasVersionProperty() { return clazz.isVersioned() && clazz instanceof RootClass; }
public boolean isVersioned() { return getSuperclass().isVersioned(); } public Property getVersion() {
@Override public boolean isVersioned() { return getSuperclass().isVersioned(); }
public boolean isVersioned() { return getSuperclass().isVersioned(); } public Property getVersion() {
public boolean isVersioned() { return getSuperclass().isVersioned(); } public Property getVersion() {
public boolean isVersioned() { return getSuperclass().isVersioned(); } public Property getVersion() {
public static CacheDataDescriptionImpl decode(PersistentClass model) { return new CacheDataDescriptionImpl( model.isMutable(), model.isVersioned(), model.isVersioned() ? ( ( VersionType ) model.getVersion().getType() ).getComparator() : null ); }
public static CacheDataDescriptionImpl decode(PersistentClass model) { return new CacheDataDescriptionImpl( model.isMutable(), model.isVersioned(), model.isVersioned() ? ( ( VersionType ) model.getVersion().getType() ).getComparator() : null ); }
@SuppressWarnings("unchecked") public static String makeUnique(PersistentClass clazz, String propertyName) { List<Property> list = new ArrayList<Property>(); if( clazz.hasIdentifierProperty() ) { list.add( clazz.getIdentifierProperty() ); } if( clazz.isVersioned() ) { list.add( clazz.getVersion() ); } Iterator<Property> propertyClosureIterator = clazz.getPropertyClosureIterator(); JoinedIterator<Property> iterator = new JoinedIterator<Property>( list.iterator(), propertyClosureIterator); return BinderUtils.makeUnique(iterator, propertyName); }
@SuppressWarnings("unchecked") public static String makeUnique(PersistentClass clazz, String propertyName) { List<Property> list = new ArrayList<Property>(); if( clazz.hasIdentifierProperty() ) { list.add( clazz.getIdentifierProperty() ); } if( clazz.isVersioned() ) { list.add( clazz.getVersion() ); } Iterator<Property> propertyClosureIterator = clazz.getPropertyClosureIterator(); JoinedIterator<Property> iterator = new JoinedIterator<Property>( list.iterator(), propertyClosureIterator); return BinderUtils.makeUnique(iterator, propertyName); }
public static CacheDataDescriptionImpl decode(Collection model) { return new CacheDataDescriptionImpl( model.isMutable(), model.getOwner().isVersioned(), model.getOwner().isVersioned() ? ( ( VersionType ) model.getOwner().getVersion().getType() ).getComparator() : null ); }
public static CacheDataDescriptionImpl decode(Collection model) { return new CacheDataDescriptionImpl( model.isMutable(), model.getOwner().isVersioned(), model.getOwner().isVersioned() ? ( ( VersionType ) model.getOwner().getVersion().getType() ).getComparator() : null ); }