/** * Gets the schema name. * * @return the schema name */ public String getSchemaName() { return isInherited() ? this.model.schemaName : null; }
/** * Gets the discriminator column. * * @return the discriminator column */ public String getDiscriminatorColumn() { return isInherited() ? this.model.discriminatorColumn : null; }
/** * Gets the discriminator value. * * @return the discriminator value */ public String getDiscriminatorValue() { return isInherited() ? this.model.discriminatorValue : null; }
/** * Gets the table name. * * @return the table name */ public String getTableName() { return isInherited() ? this.model.tableName : null; }
/** * Gets the inheritence type. * * @return the inheritence type */ public InheritanceType getInheritenceType() { return isInherited() ? this.model.inheritenceType : null; }
/** * Adds the discriminator clause. * * @param clauses * the clauses * @param entityType * the entity type */ private void addDiscriminatorClause(List<String> clauses, EntityType entityType) { if (((AbstractManagedType) entityType).isInherited()) { String discrColumn = ((AbstractManagedType) entityType).getDiscriminatorColumn(); String discrValue = ((AbstractManagedType) entityType).getDiscriminatorValue(); if (discrColumn != null && discrValue != null) { if (clauses != null && !clauses.isEmpty()) { filtersQueue.add("AND"); } FilterClause filterClause = new FilterClause(discrColumn, "=", discrValue, discrColumn); filtersQueue.add(filterClause); } } }
/** * Gets the filter for discr column. * * @param m * the m * @return the filter for discr column */ private Filter getFilterForDiscrColumn(EntityMetadata m) { MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata() .getMetamodel(m.getPersistenceUnit()); AbstractManagedType entity = (AbstractManagedType) metaModel.entity(m.getEntityClazz()); if (entity.isInherited()) { return new SingleColumnValueFilter(Bytes.toBytes(m.getTableName()), Bytes.toBytes(entity.getDiscriminatorColumn()), CompareOp.EQUAL, Bytes.toBytes(entity.getDiscriminatorValue())); } return null; }
if (((AbstractManagedType) entityType).isInherited())
if (((AbstractManagedType) entityType).isInherited())