@Test public void testInverseRelationship() throws Exception { EntityMeta entityMeta = entityMetaFactory.getEntityMeta(Bbb.class); ForeignKeyDesc foreignKeyDesc = foreignKeyDescFactory .getForeignKeyDesc(entityMeta, entityMeta .getPropertyMeta("aaas")); assertNull(foreignKeyDesc); }
public ForeignKeyDesc getForeignKeyDesc(EntityMeta entityMeta, PropertyMeta propertyMeta) { if (!propertyMeta.isRelationship() || propertyMeta.getMappedBy() != null) { return null; } ReferentialConstraint referentialConstraint = propertyMeta.getField() .getAnnotation(ReferentialConstraint.class); if (referentialConstraint == null) { if (!regardRelationshipAsFk) { return null; } } else { if (!referentialConstraint.enable()) { return null; } } ForeignKeyDesc foreignKeyDesc = new ForeignKeyDesc(); doColumn(entityMeta, propertyMeta, foreignKeyDesc); doTable(entityMeta, propertyMeta, foreignKeyDesc); doReferetialAction(entityMeta, propertyMeta, foreignKeyDesc); return foreignKeyDesc; }
ForeignKeyDescFactoryImpl implements ForeignKeyDescFactory { public ForeignKeyDesc getForeignKeyDesc(EntityMeta entityMeta, PropertyMeta propertyMeta) { if (!propertyMeta.isRelationship() || propertyMeta.getMappedBy() != null) { return null; } ReferentialConstraint referentialConstraint = propertyMeta.getField() .getAnnotation(ReferentialConstraint.class); if (referentialConstraint == null) { if (!regardRelationshipAsFk) { return null; } } else { if (!referentialConstraint.enable()) { return null; } } ForeignKeyDesc foreignKeyDesc = new ForeignKeyDesc(); doColumn(entityMeta, propertyMeta, foreignKeyDesc); doTable(entityMeta, propertyMeta, foreignKeyDesc); doReferetialAction(entityMeta, propertyMeta, foreignKeyDesc); return foreignKeyDesc; } }
ForeignKeyDescFactoryImpl implements ForeignKeyDescFactory { public ForeignKeyDesc getForeignKeyDesc(EntityMeta entityMeta, PropertyMeta propertyMeta) { if (!propertyMeta.isRelationship() || propertyMeta.getMappedBy() != null) { return null; } ReferentialConstraint referentialConstraint = propertyMeta.getField() .getAnnotation(ReferentialConstraint.class); if (referentialConstraint == null) { if (!regardRelationshipAsFk) { return null; } } else { if (!referentialConstraint.enable()) { return null; } } ForeignKeyDesc foreignKeyDesc = new ForeignKeyDesc(); doColumn(entityMeta, propertyMeta, foreignKeyDesc); doTable(entityMeta, propertyMeta, foreignKeyDesc); doReferetialAction(entityMeta, propertyMeta, foreignKeyDesc); return foreignKeyDesc; } ForeignKeyDescFactoryImpl(GenDialect dialect,
            EntityMetaFactory entityMetaFactory, boolean regardRelationshipAsFk); }
ForeignKeyDescFactoryImpl implements ForeignKeyDescFactory { public ForeignKeyDesc getForeignKeyDesc(EntityMeta entityMeta, PropertyMeta propertyMeta) { if (!propertyMeta.isRelationship() || propertyMeta.getMappedBy() != null) { return null; } ReferentialConstraint referentialConstraint = propertyMeta.getField() .getAnnotation(ReferentialConstraint.class); if (referentialConstraint == null) { if (!regardRelationshipAsFk) { return null; } } else { if (!referentialConstraint.enable()) { return null; } } ForeignKeyDesc foreignKeyDesc = new ForeignKeyDesc(); doColumn(entityMeta, propertyMeta, foreignKeyDesc); doTable(entityMeta, propertyMeta, foreignKeyDesc); doReferetialAction(entityMeta, propertyMeta, foreignKeyDesc); return foreignKeyDesc; } ForeignKeyDescFactoryImpl(GenDialect dialect,
            EntityMetaFactory entityMetaFactory, boolean regardRelationshipAsFk); ForeignKeyDesc getForeignKeyDesc(EntityMeta entityMeta,
            PropertyMeta propertyMeta); }
ForeignKeyDescFactoryImpl implements ForeignKeyDescFactory { public ForeignKeyDesc getForeignKeyDesc(EntityMeta entityMeta, PropertyMeta propertyMeta) { if (!propertyMeta.isRelationship() || propertyMeta.getMappedBy() != null) { return null; } ReferentialConstraint referentialConstraint = propertyMeta.getField() .getAnnotation(ReferentialConstraint.class); if (referentialConstraint == null) { if (!regardRelationshipAsFk) { return null; } } else { if (!referentialConstraint.enable()) { return null; } } ForeignKeyDesc foreignKeyDesc = new ForeignKeyDesc(); doColumn(entityMeta, propertyMeta, foreignKeyDesc); doTable(entityMeta, propertyMeta, foreignKeyDesc); doReferetialAction(entityMeta, propertyMeta, foreignKeyDesc); return foreignKeyDesc; } ForeignKeyDescFactoryImpl(GenDialect dialect,
            EntityMetaFactory entityMetaFactory, boolean regardRelationshipAsFk); ForeignKeyDesc getForeignKeyDesc(EntityMeta entityMeta,
            PropertyMeta propertyMeta);  }