@Override public Property getProperty(String propertyName) { return component.getProperty( propertyName ); }
virtualProperty = virtualComponent.getProperty( property.getName() );
String element = (String) st.nextElement(); if ( property == null ) { property = component.getProperty( element ); return null; property = ( (Component) property.getValue() ).getProperty( element ); String element = (String) st.nextElement(); if ( property == null ) { property = component.getOwner().getIdentifierMapper().getProperty( element ); return null; property = ( (Component) property.getValue() ).getProperty( element );
property = ( (Component) property.getValue() ).getProperty( element );
return null; property = ( (Component) property.getValue() ).getProperty( element ); String element = (String) st.nextElement(); if ( property == null ) { property = associatedClass.getIdentifierMapper().getProperty( element ); return null; property = ( (Component) property.getValue() ).getProperty( element );
return null; property = ( (Component) property.getValue() ).getProperty( element ); String element = (String) st.nextElement(); if ( property == null ) { property = associatedClass.getIdentifierMapper().getProperty( element ); return null; property = ( (Component) property.getValue() ).getProperty( element );
private void checkComposite(Component composite) throws Exception { // check `eyeColor` final Property eyeColorProperty = composite.getProperty( "eyeColor" ); final SimpleValue eyeColorValueMapping = (SimpleValue) eyeColorProperty.getValue(); assertThat( simpleValueAttributeConverterDescriptorField.get( eyeColorValueMapping ), CoreMatchers.notNullValue() ); // check `hairColor` final Property hairColorProperty = composite.getProperty( "hairColor" ); final SimpleValue hairColorValueMapping = (SimpleValue) hairColorProperty.getValue(); assertThat( simpleValueAttributeConverterDescriptorField.get( hairColorValueMapping ), CoreMatchers.notNullValue() ); }
@Override protected void afterMetadataBuilt(Metadata metadata) { Collection children = metadata.getCollectionBinding( Parent.class.getName() + ".children" ); Component childComponents = ( Component ) children.getElement(); Formula f = ( Formula ) childComponents.getProperty( "bioLength" ).getValue().getColumnIterator().next(); SQLFunction lengthFunction = metadata.getDatabase().getJdbcEnvironment().getDialect().getFunctions().get( "length" ); if ( lengthFunction != null ) { ArrayList args = new ArrayList(); args.add( "bio" ); f.setFormula( lengthFunction.render( StandardBasicTypes.INTEGER, args, null ) ); } }
@Override protected void afterMetadataBuilt(Metadata metadata) { // Oracle and Postgres do not have year() functions, so we need to // redefine the 'User.person.yob' formula // // consider temporary until we add the capability to define // mapping formulas which can use dialect-registered functions... PersistentClass user = metadata.getEntityBinding( User.class.getName() ); org.hibernate.mapping.Property personProperty = user.getProperty( "person" ); Component component = ( Component ) personProperty.getValue(); Formula f = ( Formula ) component.getProperty( "yob" ).getValue().getColumnIterator().next(); SQLFunction yearFunction = metadata.getDatabase().getJdbcEnvironment().getDialect().getFunctions().get( "year" ); if ( yearFunction == null ) { // the dialect not know to support a year() function, so rely on the // ANSI SQL extract function f.setFormula( "extract( year from dob )"); } else { List args = new ArrayList(); args.add( "dob" ); f.setFormula( yearFunction.render( StandardBasicTypes.INTEGER, args, null ) ); } }
final Component component = (Component) property.getValue(); for ( String componentPropertyName : componentAuditingData.getNonSyntheticPropertyNames() ) { final Property componentProperty = component.getProperty( componentPropertyName ); updateCalculatedProperty( entityName, componentProperty, componentPropertyName, componentAuditingData );
@Test @FailureExpected( jiraKey = "HHH-9089" ) public void testEnumTypeInterpretation() { StandardServiceRegistry ssr = new StandardServiceRegistryBuilder().build(); try { final Metadata metadata = new MetadataSources( ssr ) .addAnnotatedClass( Customer.class ) .buildMetadata(); PersistentClass classMetadata = metadata.getEntityBinding( Customer.class.getName() ); Property investmentsProperty = classMetadata.getProperty( "investments" ); Collection investmentsValue = (Collection) investmentsProperty.getValue(); Component investmentMetadata = (Component) investmentsValue.getElement(); Value descriptionValue = investmentMetadata.getProperty( "description" ).getValue(); assertEquals( 1, descriptionValue.getColumnSpan() ); Column selectable = (Column) descriptionValue.getColumnIterator().next(); assertEquals( 500, selectable.getLength() ); Component amountMetadata = (Component) investmentMetadata.getProperty( "amount" ).getValue(); SimpleValue currencyMetadata = (SimpleValue) amountMetadata.getProperty( "currency" ).getValue(); CustomType currencyType = (CustomType) currencyMetadata.getType(); int[] currencySqlTypes = currencyType.sqlTypes( metadata ); assertEquals( 1, currencySqlTypes.length ); assertJdbcTypeCode( Types.VARCHAR, currencySqlTypes[0] ); } finally { StandardServiceRegistryBuilder.destroy( ssr ); } } }
Collection investmentsValue = (Collection) investmentsProperty.getValue(); Component investmentMetadata = (Component) investmentsValue.getElement(); Value descriptionValue = investmentMetadata.getProperty( "description" ).getValue(); assertEquals( 1, descriptionValue.getColumnSpan() ); Column selectable = (Column) descriptionValue.getColumnIterator().next(); assertEquals( 500, selectable.getLength() ); Component amountMetadata = (Component) investmentMetadata.getProperty( "amount" ).getValue(); SimpleValue currencyMetadata = (SimpleValue) amountMetadata.getProperty( "currency" ).getValue(); CustomType currencyType = (CustomType) currencyMetadata.getType(); int[] currencySqlTypes = currencyType.sqlTypes( metadata );
buildGenerators( property, buildingContext ); SecondPass secondPass = new IdGeneratorResolverSecondPass( (SimpleValue) comp.getProperty( property.getName() ).getValue(), property, generatorType, localGenerators.putAll( buildGenerators( property, buildingContext ) ); BinderHelper.makeIdGenerator( (SimpleValue) comp.getProperty( property.getName() ).getValue(), property, generatorType,
assertEquals(compimplements.getValue(), "AnotherInterface"); Property xp = ((Component)element.getValue()).getProperty( "x" ); MetaAttribute propximplements = xp.getMetaAttribute( "implements" ); assertNotNull(propximplements);
property = component.getProperty( "x" ); propertyAttribute = property.getMetaAttribute( "globalmutated" ); property = component.getProperty( "emp" ); propertyAttribute = property.getMetaAttribute( "globalmutated" ); property = component.getProperty( "empinone" ); propertyAttribute = property.getMetaAttribute( "globalmutated" );
String element = (String) st.nextElement(); if ( property == null ) { property = component.getProperty( element ); property = ( (Component) property.getValue() ).getProperty( element ); String element = (String) st.nextElement(); if ( property == null ) { property = component.getOwner().getIdentifierMapper().getProperty( element ); property = ( (Component) property.getValue() ).getProperty( element );
mainGenerator.addValue( parentXmlMapping, component.getProperty( auditedPropertyName ).getValue(), componentMapper, prefix, xmlMappingData, mainGenerator.addValue( parentXmlMapping, component.getProperty( auditedPropertyName ).getValue(), componentMapper, referencingEntityName,
property = ( (Component) property.getValue() ).getProperty( element ); String element = (String) st.nextElement(); if ( property == null ) { property = associatedClass.getIdentifierMapper().getProperty( element ); property = ( (Component) property.getValue() ).getProperty( element );
property = ( ( Component ) property.getValue() ).getProperty( element ); String element = (String) st.nextElement(); if ( property == null ) { property = associatedClass.getIdentifierMapper().getProperty( element ); property = ( (Component) property.getValue() ).getProperty( element );
try { referencesDerivedId = otherSide.getIdentifier() instanceof Component && ( (Component) otherSide.getIdentifier() ).getProperty( mappedBy ) != null;