Map ma = element.getMetaAttributes(); assertNotNull(ma); assertNotNull(element.getMetaAttribute("global")); MetaAttribute metaAttribute2 = element.getMetaAttribute("implements"); assertNotNull(metaAttribute2); assertNull(element.getMetaAttribute("globalnoinherit")); Map ma = element.getMetaAttributes(); assertNotNull(ma); assertNotNull(element.getMetaAttribute("global")); assertNotNull(element.getMetaAttribute("componentonly")); assertNotNull(element.getMetaAttribute("allcomponent")); assertNull(element.getMetaAttribute("globalnoinherit")); MetaAttribute compimplements = element.getMetaAttribute("implements"); assertNotNull(compimplements); assertEquals(compimplements.getValue(), "AnotherInterface"); MetaAttribute propximplements = xp.getMetaAttribute( "implements" ); assertNotNull(propximplements); assertEquals(propximplements.getValue(), "AnotherInterface");
MetaAttribute propertyAttribute = property.getMetaAttribute( "globalmutated" ); propertyAttribute = property.getMetaAttribute( "globalmutated" ); propertyAttribute = property.getMetaAttribute( "globalmutated" ); propertyAttribute = property.getMetaAttribute( "globalmutated" ); propertyAttribute = property.getMetaAttribute( "globalmutated" ); propertyAttribute = property.getMetaAttribute( "globalmutated" );
public boolean hasFieldJavaDoc(Property property) { return property.getMetaAttribute("field-description")!=null; }
public boolean hasFieldJavaDoc(Property property) { return property.getMetaAttribute("field-description")!=null; }
public String getFieldDescription(Property property){ MetaAttribute c = property.getMetaAttribute( "field-description" ); if ( c == null ) { return ""; } else { return c2j.getMetaAsString( property, "field-description" ); } }
public String getFieldDescription(Property property){ MetaAttribute c = property.getMetaAttribute( "field-description" ); if ( c == null ) { return ""; } else { return c2j.getMetaAsString( property, "field-description" ); } }
private String getModifiers(Property property, String modifiername, String defaultModifiers) { MetaAttribute override = property.getMetaAttribute( modifiername ); if ( override != null ) { return MetaAttributeHelper.getMetaAsString( override ); } else { return defaultModifiers; } }
private String getModifiers(Property property, String modifiername, String defaultModifiers) { MetaAttribute override = property.getMetaAttribute( modifiername ); if ( override != null ) { return MetaAttributeHelper.getMetaAsString( override ); } else { return defaultModifiers; } }
public String getFieldJavaDoc(Property property, int indent) { MetaAttribute c = property.getMetaAttribute( "field-description" ); if ( c == null ) { return c2j.toJavaDoc( "", indent ); } else { return c2j.toJavaDoc( c2j.getMetaAsString( property, "field-description" ), indent ); } }
public String getFieldJavaDoc(Property property, int indent) { MetaAttribute c = property.getMetaAttribute( "field-description" ); if ( c == null ) { return c2j.toJavaDoc( "", indent ); } else { return c2j.toJavaDoc( c2j.getMetaAsString( property, "field-description" ), indent ); } }
public Setter getSetter(final Class theClass, final String propertyName) throws PropertyNotFoundException { Setter setter = null; Property thisProperty = HibernateUtil.getConfiguration().getClassMapping(theClass.getName()).getProperty(propertyName); MetaAttribute propertyMeta = thisProperty.getMetaAttribute(PropertyHelper.NAKED_PROPERTY); if (propertyMeta != null) { String access = null; MetaAttribute accessMeta = thisProperty.getMetaAttribute(PropertyHelper.NAKED_ACCESS); if (accessMeta != null) { access = accessMeta.getValue(); } PropertyAccessor wrappedAccessor = PropertyAccessorFactory.getPropertyAccessor(access); if (wrappedAccessor != null) { setter = wrappedAccessor.getSetter(theClass, propertyMeta.getValue()); } } return new OptimisticLockSetter( theClass, propertyName, getLongVersionAccessor(), setter); }
public Getter getGetter(final Class theClass, final String propertyName) throws PropertyNotFoundException { Property thisProperty = HibernateUtil.getConfiguration().getClassMapping(theClass.getName()).getProperty(propertyName); MetaAttribute propertyMeta = thisProperty.getMetaAttribute(PropertyHelper.NAKED_PROPERTY); if (propertyMeta != null) { String access = null; MetaAttribute accessMeta = thisProperty.getMetaAttribute(PropertyHelper.NAKED_ACCESS); if (accessMeta != null) { access = accessMeta.getValue(); } PropertyAccessor wrappedAccessor = PropertyAccessorFactory.getPropertyAccessor(access); if (wrappedAccessor != null) { return wrappedAccessor.getGetter(theClass, propertyMeta.getValue()); } } return new OptimisticLockGetter( theClass, propertyName, getLongVersionAccessor() ); } }
@Test public void testMetaAttributeMappings() { PersistentClass classMapping = metadata.getEntityBinding( "Orders" ); Assert.assertEquals("order table value", classMapping.getMetaAttribute( "order-meta" ).getValue()); Property property = classMapping.getProperty("orderName"); Assert.assertEquals("order column value", property.getMetaAttribute( "order-meta" ).getValue()); //TODO: test sequence of meta }
public String getFieldInitialization(Property p, boolean useGenerics) { if(hasMetaAttribute(p, "default-value")) { return MetaAttributeHelper.getMetaAsString( p.getMetaAttribute( "default-value" ) );
public String getFieldInitialization(Property p, boolean useGenerics) { if(hasMetaAttribute(p, "default-value")) { return MetaAttributeHelper.getMetaAsString( p.getMetaAttribute( "default-value" ) );