Java Code Examples for org.hibernate.mapping.Property#setNodeName()

The following examples show how to use org.hibernate.mapping.Property#setNodeName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Dom4jAccessorTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private Property generateIdProperty() {
	SimpleValue value = new SimpleValue();
	value.setTypeName( "long" );

	Property property = new Property();
	property.setName( "id" );
	property.setNodeName( "@id" );
	property.setValue( value );

	return property;
}
 
Example 2
Source File: Dom4jAccessorTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private Property generateTextProperty() {
	SimpleValue value = new SimpleValue();
	value.setTypeName( "string" );

	Property property = new Property();
	property.setName( "text" );
	property.setNodeName( "." );
	property.setValue( value );

	return property;
}
 
Example 3
Source File: Dom4jAccessorTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private Property generateAccountIdProperty() {
	SimpleValue value = new SimpleValue();
	value.setTypeName( "long" );

	Property property = new Property();
	property.setName( "number" );
	property.setNodeName( "account/@num" );
	property.setValue( value );

	return property;
}
 
Example 4
Source File: Dom4jAccessorTest.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private Property generateNameProperty() {
	SimpleValue value = new SimpleValue();
	value.setTypeName( "string" );

	Property property = new Property();
	property.setName( "name" );
	property.setNodeName( "name" );
	property.setValue( value );

	return property;
}
 
Example 5
Source File: HbmBinder.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public static void bindCompositeId(Element node, Component component,
		PersistentClass persistentClass, String propertyName, Mappings mappings,
		java.util.Map inheritedMetas) throws MappingException {

	component.setKey( true );

	String path = StringHelper.qualify(
			persistentClass.getEntityName(),
			propertyName == null ? "id" : propertyName );

	bindComponent(
			node,
			component,
			persistentClass.getClassName(),
			propertyName,
			path,
			false,
			node.attribute( "class" ) == null
					&& propertyName == null,
			mappings,
			inheritedMetas,
			false
		);

	if ( "true".equals( node.attributeValue("mapped") ) ) {
		if ( propertyName!=null ) {
			throw new MappingException("cannot combine mapped=\"true\" with specified name");
		}
		Component mapper = new Component(persistentClass);
		bindComponent(
				node,
				mapper,
				persistentClass.getClassName(),
				null,
				path,
				false,
				true,
				mappings,
				inheritedMetas,
				true
			);
		persistentClass.setIdentifierMapper(mapper);
		Property property = new Property();
		property.setName("_identifierMapper");
		property.setNodeName("id");
		property.setUpdateable(false);
		property.setInsertable(false);
		property.setValue(mapper);
		property.setPropertyAccessorName( "embedded" );
		persistentClass.addProperty(property);
	}

}