Java Code Examples for javax.persistence.Table

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project portal, under directory /portal-core/src/main/java/org/devproof/portal/core/module/modulemgmt/panel/.

Source file: ModuleInfoPanel.java

  22 
vote

private String getTableName(Class<?> entity){
  String table=entity.getSimpleName();
  Table tableAnno=entity.getAnnotation(Table.class);
  if (tableAnno != null && StringUtils.isNotEmpty(tableAnno.name())) {
    table=tableAnno.name();
  }
  return table;
}
 

Example 2

From project grails-data-mapping, under directory /grails-datastore-jpa/src/main/groovy/org/grails/datastore/mapping/jpa/config/.

Source file: JpaPersistentEntity.java

  19 
vote

@Override public ClassMapping<Table> getMapping(){
  return new ClassMapping<Table>(){
    @Override public PersistentEntity getEntity(){
      return JpaPersistentEntity.this;
    }
    @Override public Table getMappedForm(){
      return (Table)getJavaClass().getAnnotation(Table.class);
    }
    @Override public IdentityMapping getIdentifier(){
      return null;
    }
  }
;
}