/** * Gets the table name from annotation. */ protected TableName getTableNameFromAnnotation(Class<?> beanClass) { final Table t = findTableAnnotation(beanClass); // Take the annotation if defined if (t != null && !isEmpty(t.name())) { // Note: empty catalog and schema are converted to null // Only need to convert quoted identifiers from annotations return new TableName(quoteIdentifiers(t.catalog()), quoteIdentifiers(t.schema()), quoteIdentifiers(t.name())); } // No annotation return null; }
TableName tableName = getTableNameFromAnnotation(beanClass); if (tableName == null) { Class<?> supCls = beanClass.getSuperclass(); if (hasInheritance(supCls)) { return getTableName(supCls); tableName = getTableNameByConvention(beanClass); if (isEmpty(catalog)) { catalog = getCatalog(); if (isEmpty(schema)) { schema = getSchema();
private NamingConvention createNamingConvention(PropertySource p) { NamingConvention nc = createInstance(p, NamingConvention.class, "namingconvention"); if (nc == null) { return null; } if (nc instanceof AbstractNamingConvention) { AbstractNamingConvention anc = (AbstractNamingConvention) nc; String v = p.get("namingConvention.useForeignKeyPrefix", null); if (v != null) { boolean useForeignKeyPrefix = Boolean.valueOf(v); anc.setUseForeignKeyPrefix(useForeignKeyPrefix); } String sequenceFormat = p.get("namingConvention.sequenceFormat", null); if (sequenceFormat != null) { anc.setSequenceFormat(sequenceFormat); } } return nc; }
/** * Search recursively for an @Table in the class hierarchy. */ protected Table findTableAnnotation(Class<?> cls) { if (cls.equals(Object.class)) { return null; } Table table = cls.getAnnotation(Table.class); if (table != null) { return table; } return findTableAnnotation(cls.getSuperclass()); }
TableName tableName = getTableNameFromAnnotation(beanClass); if (tableName == null) { return getTableName(supCls); tableName = getTableNameByConvention(beanClass); if (isEmpty(catalog)) { catalog = getCatalog(); if (isEmpty(schema)) { schema = getSchema();
private NamingConvention createNamingConvention(PropertySource p) { NamingConvention nc = createInstance(p, NamingConvention.class, "namingconvention"); if (nc == null) { return null; } if (nc instanceof AbstractNamingConvention) { AbstractNamingConvention anc = (AbstractNamingConvention) nc; String v = p.get("namingConvention.useForeignKeyPrefix", null); if (v != null) { boolean useForeignKeyPrefix = Boolean.valueOf(v); anc.setUseForeignKeyPrefix(useForeignKeyPrefix); } String sequenceFormat = p.get("namingConvention.sequenceFormat", null); if (sequenceFormat != null) { anc.setSequenceFormat(sequenceFormat); } } return nc; }
/** * Search recursively for an @Table in the class hierarchy. */ protected Table findTableAnnotation(Class<?> cls) { if (cls.equals(Object.class)) { return null; } Table table = cls.getAnnotation(Table.class); if (table != null) { return table; } return findTableAnnotation(cls.getSuperclass()); }
TableName tableName = getTableNameFromAnnotation(beanClass); if (tableName == null) { return getTableName(supCls); tableName = getTableNameByConvention(beanClass); if (isEmpty(catalog)) { catalog = getCatalog(); if (isEmpty(schema)) { schema = getSchema();
/** * Gets the table name from annotation. */ protected TableName getTableNameFromAnnotation(Class<?> beanClass) { final Table t = findTableAnnotation(beanClass); // Take the annotation if defined if (t != null && !isEmpty(t.name())) { // Note: empty catalog and schema are converted to null // Only need to convert quoted identifiers from annotations return new TableName(quoteIdentifiers(t.catalog()), quoteIdentifiers(t.schema()), quoteIdentifiers(t.name())); } // No annotation return null; }
/** * Search recursively for an @Table in the class hierarchy. */ protected Table findTableAnnotation(Class<?> cls) { if (cls.equals(Object.class)) { return null; } Table table = cls.getAnnotation(Table.class); if (table != null) { return table; } return findTableAnnotation(cls.getSuperclass()); }
/** * Gets the table name from annotation. */ protected TableName getTableNameFromAnnotation(Class<?> beanClass) { final Table t = findTableAnnotation(beanClass); // Take the annotation if defined if (t != null && !isEmpty(t.name())) { // Note: empty catalog and schema are converted to null // Only need to convert quoted identifiers from annotations return new TableName(quoteIdentifiers(t.catalog()), quoteIdentifiers(t.schema()), quoteIdentifiers(t.name())); } // No annotation return null; }