List of usage examples for org.hibernate.tuple NonIdentifierAttribute isInsertable
public boolean isInsertable();
From source file:com.github.kuros.random.jpa.metamodel.AttributeProvider.java
License:Open Source License
private List<String> getSupportedAttributeNames(final SingleTableEntityPersister singleTableEntityPersister) { final EntityMetamodel entityMetamodel = singleTableEntityPersister.getEntityMetamodel(); final NonIdentifierAttribute[] properties = entityMetamodel.getProperties(); final List<String> attributeNames = new ArrayList<String>(); for (NonIdentifierAttribute property : properties) { if (property.isInsertable()) { if (property instanceof EntityBasedAssociationAttribute) { final EntityBasedAssociationAttribute entityBasedAssociationAttribute = (EntityBasedAssociationAttribute) property; if (!(entityBasedAssociationAttribute .getAssociationNature() == AssociationAttributeDefinition.AssociationNature.ENTITY)) { continue; }//w w w . j a va 2s . c om } attributeNames.add(property.getName()); } } final IdentifierProperty identifierProperty = entityMetamodel.getIdentifierProperty(); attributeNames.add(identifierProperty.getName()); return attributeNames; }