if ( property.getAttribute().isSingular() ) {
final SingularAttributeBinding singularAttributeBinding = ( SingularAttributeBinding ) property;
final CascadeStyle cascadeStyle = singularAttributeBinding.isAssociation()
? ( (AssociationAttributeBinding) singularAttributeBinding ).getCascadeStyle()
: CascadeStyle.NONE;
final FetchMode fetchMode = singularAttributeBinding.isAssociation()
? ( (AssociationAttributeBinding) singularAttributeBinding ).getFetchMode()
: FetchMode.DEFAULT;
return new StandardProperty(
singularAttributeBinding.getAttribute().getName(),
null,
type,
lazyAvailable && singularAttributeBinding.isLazy(),
true, // insertable
true, // updatable
singularAttributeBinding.getGeneration() == PropertyGeneration.INSERT
|| singularAttributeBinding.getGeneration() == PropertyGeneration.ALWAYS,
singularAttributeBinding.getGeneration() == PropertyGeneration.ALWAYS,
singularAttributeBinding.isNullable(),
alwaysDirtyCheck || areAllValuesIncludedInUpdate( singularAttributeBinding ),
singularAttributeBinding.isIncludedInOptimisticLocking(),
cascadeStyle,
fetchMode
);
}
else {
final AbstractPluralAttributeBinding pluralAttributeBinding = (AbstractPluralAttributeBinding) property;
final CascadeStyle cascadeStyle = pluralAttributeBinding.isAssociation()
? pluralAttributeBinding.getCascadeStyle()
: CascadeStyle.NONE;
final FetchMode fetchMode = pluralAttributeBinding.isAssociation()
? pluralAttributeBinding.getFetchMode()
: FetchMode.DEFAULT;
return new StandardProperty(
pluralAttributeBinding.getAttribute().getName(),