property = "_id";
f = (Field) m.getIdAttribute().getJavaMember();
if (metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType())
&& value.getClass().isAssignableFrom(f.getType()))
{
EmbeddableType compoundKey = metaModel.embeddable(m.getIdAttribute().getBindableJavaType());
compositeColumns = MongoDBUtils.getCompoundKeyColumns(m, value, compoundKey);
isCompositeColumn = true;
continue;
}
}
else if (metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType())
&& StringUtils.contains(property, '.'))
{
// Means it is a case of composite column.
property = property.substring(property.indexOf(".") + 1);
isCompositeColumn = true;
} /*
* if a composite key. "." assuming "." is part of property in
* case of embeddable only
*/
else if (StringUtils.contains(property, '.'))
{
EntityType entity = metaModel.entity(m.getEntityClazz());
StringTokenizer tokenizer = new StringTokenizer(property, ".");
String embeddedAttributeAsStr = tokenizer.nextToken();
String embeddableAttributeAsStr = tokenizer.nextToken();
Attribute embeddedAttribute = entity.getAttribute(embeddedAttributeAsStr);
EmbeddableType embeddableEntity = metaModel.embeddable(((AbstractAttribute) embeddedAttribute)
.getBindableJavaType());
f = (Field) embeddableEntity.getAttribute(embeddableAttributeAsStr).getJavaMember();
property = ((AbstractAttribute) embeddedAttribute).getJPAColumnName()
+ "."
+ ((AbstractAttribute) embeddableEntity.getAttribute(embeddableAttributeAsStr))
.getJPAColumnName();
}
else
{
EntityType entity = metaModel.entity(m.getEntityClazz());