Java Code Examples for org.hibernate.persister.entity.EntityPersister.ENTITY_ID

The following are Jave code examples for showing how to use ENTITY_ID of the org.hibernate.persister.entity.EntityPersister class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: lams   File: FromElement.java   View Source Code Vote up 6 votes
public String[] getIdentityColumns() {
	checkInitialized();
	final String table = getTableAlias();
	if ( table == null ) {
		throw new IllegalStateException( "No table alias for node " + this );
	}

	final String propertyName;
	if ( getEntityPersister() != null && getEntityPersister().getEntityMetamodel() != null
			&& getEntityPersister().getEntityMetamodel().hasNonIdentifierPropertyNamedId() ) {
		propertyName = getEntityPersister().getIdentifierPropertyName();
	}
	else {
		propertyName = EntityPersister.ENTITY_ID;
	}

	if ( getWalker().getStatementType() == HqlSqlTokenTypes.SELECT ) {
		return getPropertyMapping( propertyName ).toColumns( table, propertyName );
	}
	else {
		return getPropertyMapping( propertyName ).toColumns( propertyName );
	}
}
 
Example 2
Project: lams   File: PathExpressionParser.java   View Source Code Vote up 6 votes
private String getPropertyPath() {
	if ( currentProperty == null ) {
		return EntityPersister.ENTITY_ID;
	}
	else {
		if ( componentPath.length() > 0 ) {
			return new StringBuilder()
					.append( currentProperty )
					.append( '.' )
					.append( componentPath.toString() )
					.toString();
		}
		else {
			return currentProperty;
		}
	}
}