Java Examples for org.hibernate.Internal
The following java examples will help you to understand the usage of org.hibernate.Internal. These source code samples are taken from different open source projects.
Example 1
Project: hibernate-orm-master File: PropertyFactory.java View source code |
/**
* Generate a non-identifier (and non-version) attribute based on the given mapped property from the given entity
*
* @param property The mapped property.
* @param lazyAvailable Is property lazy loading currently available.
*
* @return The appropriate NonIdentifierProperty definition.
*/
public static NonIdentifierAttribute buildEntityBasedAttribute(EntityPersister persister, SessionFactoryImplementor sessionFactory, int attributeNumber, Property property, boolean lazyAvailable) {
final Type type = property.getValue().getType();
final NonIdentifierAttributeNature nature = decode(type);
// we need to dirty check collections, since they can cause an owner
// version number increment
// we need to dirty check many-to-ones with not-found="ignore" in order
// to update the cache (not the database), since in this case a null
// entity reference can lose information
boolean alwaysDirtyCheck = type.isAssociationType() && ((AssociationType) type).isAlwaysDirtyChecked();
switch(nature) {
case BASIC:
{
return new EntityBasedBasicAttribute(persister, sessionFactory, attributeNumber, property.getName(), type, new BaselineAttributeInformation.Builder().setLazy(lazyAvailable && property.isLazy()).setInsertable(property.isInsertable()).setUpdateable(property.isUpdateable()).setValueGenerationStrategy(property.getValueGenerationStrategy()).setNullable(property.isOptional()).setDirtyCheckable(alwaysDirtyCheck || property.isUpdateable()).setVersionable(property.isOptimisticLocked()).setCascadeStyle(property.getCascadeStyle()).setFetchMode(property.getValue().getFetchMode()).createInformation());
}
case COMPOSITE:
{
return new EntityBasedCompositionAttribute(persister, sessionFactory, attributeNumber, property.getName(), (CompositeType) type, new BaselineAttributeInformation.Builder().setLazy(lazyAvailable && property.isLazy()).setInsertable(property.isInsertable()).setUpdateable(property.isUpdateable()).setValueGenerationStrategy(property.getValueGenerationStrategy()).setNullable(property.isOptional()).setDirtyCheckable(alwaysDirtyCheck || property.isUpdateable()).setVersionable(property.isOptimisticLocked()).setCascadeStyle(property.getCascadeStyle()).setFetchMode(property.getValue().getFetchMode()).createInformation());
}
case ENTITY:
case ANY:
case COLLECTION:
{
return new EntityBasedAssociationAttribute(persister, sessionFactory, attributeNumber, property.getName(), (AssociationType) type, new BaselineAttributeInformation.Builder().setLazy(lazyAvailable && property.isLazy()).setInsertable(property.isInsertable()).setUpdateable(property.isUpdateable()).setValueGenerationStrategy(property.getValueGenerationStrategy()).setNullable(property.isOptional()).setDirtyCheckable(alwaysDirtyCheck || property.isUpdateable()).setVersionable(property.isOptimisticLocked()).setCascadeStyle(property.getCascadeStyle()).setFetchMode(property.getValue().getFetchMode()).createInformation());
}
default:
{
throw new HibernateException("Internal error");
}
}
}
Example 2
Project: clinic-softacad-master File: Binder.java View source code |
private EntityBinding createBasicEntityBinding(EntitySource entitySource, EntityBinding superEntityBinding) {
if (superEntityBinding == null) {
return makeRootEntityBinding((RootEntitySource) entitySource);
} else {
switch(currentInheritanceType) {
case SINGLE_TABLE:
return makeDiscriminatedSubclassBinding((SubclassEntitySource) entitySource, superEntityBinding);
case JOINED:
return makeJoinedSubclassBinding((SubclassEntitySource) entitySource, superEntityBinding);
case TABLE_PER_CLASS:
return makeUnionedSubclassBinding((SubclassEntitySource) entitySource, superEntityBinding);
default:
// extreme internal error!
throw new AssertionFailure("Internal condition failure");
}
}
}
Example 3
Project: checkstyle-master File: InputFinalLocalVariableFalsePositives.java View source code |
// openjdk8/src/share/classes/sun/text/bidi/BidiBase.java
private void foo16() {
final int a = 1;
byte level;
if (true) {
switch(a) {
case 1:
break;
case 2:
break;
case 3:
if (true) {
}
if ((true) || (true)) {
level = 1;
if (true) {
}
if (true) {
}
break;
}
for (int i = 0; i < 14; i++) {
}
if (true) {
}
break;
case 4:
if (true)
break;
case 5:
if (true) {
if (true) {
break;
}
if (true) {
}
break;
}
if (true) {
}
break;
case 6:
break;
case 7:
for (int i = 0; i < 15458; i++) {
}
if (true) {
}
break;
case 8:
break;
case 9:
if (true) {
}
break;
case 10:
level = (byte) 1;
for (int i = 0; i < 12; i++) {
if (true) {
}
}
break;
case 11:
level = 1;
for (int i = 0; i < 12; i++) {
if (true) {
while (level < 2) {
}
while (true) {
}
}
if (true) {
continue;
}
}
break;
case 12:
level = (byte) 2;
for (int i = 0; i < 12; i++) {
if (true) {
}
}
break;
default:
throw new IllegalStateException("Internal ICU error in processPropertySeq");
}
}
if (true) {
level = (byte) 12;
for (; ; ) {
}
}
}