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

io.ebeaninternal.server.deploy.PersistenceContextUtil Maven / Gradle / Ivy

There is a newer version: 15.6.0
Show newest version
package io.ebeaninternal.server.deploy;

import javax.persistence.Entity;

/**
 * Utility to find the root bean type.
 */
public class PersistenceContextUtil {

  /**
   * Find and return the root bean type for the given class.
   */
  public static Class root(Class beanType) {
    Class parent = beanType.getSuperclass();
    while (parent != null && parent.isAnnotationPresent(Entity.class)) {
      beanType = parent;
      parent = parent.getSuperclass();
    }
    return beanType;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy