All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.akquinet.jbosscc.guttenbase.hints.impl.DefaultEntityTableCheckerHint Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version
package de.akquinet.jbosscc.guttenbase.hints.impl;

import de.akquinet.jbosscc.guttenbase.hints.EntityTableCheckerHint;
import de.akquinet.jbosscc.guttenbase.meta.ColumnMetaData;
import de.akquinet.jbosscc.guttenbase.tools.EntityTableChecker;

/**
 * By default we check if the given table has an primary key column named "ID".
 * 
 * 

* © 2012-2020 akquinet tech@spree *

* * @author M. Dahm */ public class DefaultEntityTableCheckerHint extends EntityTableCheckerHint { @Override public EntityTableChecker getValue() { return tableMetaData -> { for (final ColumnMetaData columnMetaData : tableMetaData.getColumnMetaData()) { final String columnName = columnMetaData.getColumnName().toUpperCase(); if (columnMetaData.isPrimaryKey() && (columnName.equals("ID") || columnName.equals("IDENT"))) { return true; } } return false; }; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy