Search in sources :

Example 11 with AbstractPropertyFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractPropertyFacade in project jbosstools-hibernate by jbosstools.

the class Cfg2HbmToolFacadeTest method testGetPropertyTag.

public void testGetPropertyTag() throws Exception {
    RootClass rc = new RootClass(null);
    Property p = new Property();
    MetadataImplementor m = (MetadataImplementor) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { MetadataImplementor.class }, new TestInvocationHandler());
    SimpleValue sv = new SimpleValue(m);
    sv.setTypeName("foobar");
    p.setValue(sv);
    p.setPersistentClass(rc);
    rc.setVersion(p);
    IProperty property = new AbstractPropertyFacade(FACADE_FACTORY, p) {
    };
    Assert.assertEquals("version", cfg2HbmToolFacade.getTag(property));
}
Also used : RootClass(org.hibernate.mapping.RootClass) AbstractPropertyFacade(org.jboss.tools.hibernate.runtime.common.AbstractPropertyFacade) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) MetadataImplementor(org.hibernate.boot.spi.MetadataImplementor) RootClass(org.hibernate.mapping.RootClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) PersistentClass(org.hibernate.mapping.PersistentClass) Property(org.hibernate.mapping.Property) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) SimpleValue(org.hibernate.mapping.SimpleValue)

Example 12 with AbstractPropertyFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractPropertyFacade in project jbosstools-hibernate by jbosstools.

the class Cfg2HbmToolFacadeTest method testGetPropertyTag.

public void testGetPropertyTag() throws Exception {
    RootClass rc = new RootClass(null);
    Property p = new Property();
    MetadataImplementor m = (MetadataImplementor) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { MetadataImplementor.class }, new TestInvocationHandler());
    SimpleValue sv = new SimpleValue(m);
    sv.setTypeName("foobar");
    p.setValue(sv);
    p.setPersistentClass(rc);
    rc.setVersion(p);
    IProperty property = new AbstractPropertyFacade(FACADE_FACTORY, p) {
    };
    Assert.assertEquals("version", cfg2HbmToolFacade.getTag(property));
}
Also used : RootClass(org.hibernate.mapping.RootClass) AbstractPropertyFacade(org.jboss.tools.hibernate.runtime.common.AbstractPropertyFacade) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) MetadataImplementor(org.hibernate.boot.spi.MetadataImplementor) RootClass(org.hibernate.mapping.RootClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) PersistentClass(org.hibernate.mapping.PersistentClass) Property(org.hibernate.mapping.Property) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) SimpleValue(org.hibernate.mapping.SimpleValue)

Aggregations

Property (org.hibernate.mapping.Property)12 SimpleValue (org.hibernate.mapping.SimpleValue)12 AbstractPropertyFacade (org.jboss.tools.hibernate.runtime.common.AbstractPropertyFacade)12 IProperty (org.jboss.tools.hibernate.runtime.spi.IProperty)12 RootClass (org.hibernate.mapping.RootClass)11 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)11 PersistentClass (org.hibernate.mapping.PersistentClass)10 Mappings (org.hibernate.cfg.Mappings)6 MetadataImplementor (org.hibernate.boot.spi.MetadataImplementor)4 Test (org.junit.Test)4 POJOClass (org.hibernate.tool.hbm2x.pojo.POJOClass)3 IPOJOClass (org.jboss.tools.hibernate.runtime.spi.IPOJOClass)3