Codota Logo
org.hibernate.cfg.annotations.reflection
Code IndexAdd Codota to your IDE (free)

How to use org.hibernate.cfg.annotations.reflection

Best Java code snippets using org.hibernate.cfg.annotations.reflection (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: hibernate/hibernate-orm

public static String buildSafeClassName(String className, XMLContext.Default defaults) {
  return buildSafeClassName( className, defaults.getPackageName() );
}
origin: hibernate/hibernate-orm

JPAMetadataProvider(ClassLoaderAccess classLoaderAccess, boolean xmlMetadataEnabled) {
  this.classLoaderAccess = classLoaderAccess;
  this.xmlContext = new XMLContext( classLoaderAccess );
  this.xmlMappingEnabled = xmlMetadataEnabled;
}
origin: hibernate/hibernate-orm

private AttributeOverrides getMapKeyAttributeOverrides(Element tree, XMLContext.Default defaults) {
  List<AttributeOverride> attributes = buildAttributeOverrides( tree, "map-key-attribute-override" );
  return mergeAttributeOverrides( defaults, attributes, false );
}
origin: hibernate/hibernate-orm

private boolean isProcessingId(XMLContext.Default defaults) {
  boolean isExplicit = defaults.getAccess() != null;
  boolean correctAccess =
      ( PropertyType.PROPERTY.equals( propertyType ) && AccessType.PROPERTY.equals( defaults.getAccess() ) )
          || ( PropertyType.FIELD.equals( propertyType ) && AccessType.FIELD
          .equals( defaults.getAccess() ) );
  boolean hasId = defaults.canUseJavaAnnotations()
      && ( isPhysicalAnnotationPresent( Id.class ) || isPhysicalAnnotationPresent( EmbeddedId.class ) );
  //if ( properAccessOnMetadataComplete || properOverridingOnMetadataNonComplete ) {
  boolean mirrorAttributeIsId = defaults.canUseJavaAnnotations() &&
      ( mirroredAttribute != null &&
          ( mirroredAttribute.isAnnotationPresent( Id.class )
              || mirroredAttribute.isAnnotationPresent( EmbeddedId.class ) ) );
  boolean propertyIsDefault = PropertyType.PROPERTY.equals( propertyType )
      && !mirrorAttributeIsId;
  return correctAccess || ( !isExplicit && hasId ) || ( !isExplicit && propertyIsDefault );
}
origin: hibernate/hibernate-orm

public Default getDefault(String className) {
  Default xmlDefault = new Default();
  xmlDefault.override( globalDefaults );
  if ( className != null ) {
    Default entityMappingOverriding = defaultsOverriding.get( className );
    xmlDefault.override( entityMappingOverriding );
  }
  return xmlDefault;
}
origin: hibernate/hibernate-orm

private SequenceGenerator getSequenceGenerator(Element tree, XMLContext.Default defaults) {
  Element element = tree != null ? tree.element( annotationToXml.get( SequenceGenerator.class ) ) : null;
  if ( element != null ) {
    return buildSequenceGeneratorAnnotation( element );
  }
  else if ( defaults.canUseJavaAnnotations() ) {
    return getPhysicalAnnotation( SequenceGenerator.class );
  }
  else {
    return null;
  }
}
origin: hibernate/hibernate-orm

  protected XMLContext getContext(InputStream is) throws Exception {
    XMLContext xmlContext = new XMLContext( BootstrapContextImpl.INSTANCE );
    Document doc = new SAXReader().read( is );
    xmlContext.addDocument( doc );
    return xmlContext;
  }
}
origin: hibernate/hibernate-orm

@Override
public AnnotationReader getAnnotationReader(AnnotatedElement annotatedElement) {
  AnnotationReader reader = cache.get( annotatedElement );
  if (reader == null) {
    if ( xmlContext.hasContext() ) {
      reader = new JPAOverriddenAnnotationReader( annotatedElement, xmlContext, classLoaderAccess );
    }
    else {
      reader = delegate.getAnnotationReader( annotatedElement );
    }
    cache.put(annotatedElement, reader);
  }
  return reader;
}
origin: hibernate/hibernate-orm

private void setAccess(Element unitElement, Default defaultType) {
  if ( unitElement != null ) {
    String access = unitElement.getTextTrim();
    setAccess( access, defaultType );
  }
}
origin: hibernate/hibernate-orm

private void getJoinTable(List<Annotation> annotationList, Element tree, XMLContext.Default defaults) {
  addIfNotNull( annotationList, buildJoinTable( tree, defaults ) );
}
origin: hibernate/hibernate-orm

/**
 * Copy a string attribute from an XML element to an annotation descriptor. The name of the annotation attribute is
 * computed from the name of the XML attribute by {@link #getJavaAttributeNameFromXMLOne(String)}.
 *
 * @param annotation annotation descriptor where to copy to the attribute.
 * @param element XML element from where to copy the attribute.
 * @param attributeName name of the XML attribute to copy.
 * @param mandatory whether the attribute is mandatory.
 */
private static void copyStringAttribute(
    final AnnotationDescriptor annotation, final Element element,
    final String attributeName, final boolean mandatory) {
  copyStringAttribute(
      annotation,
      element,
      getJavaAttributeNameFromXMLOne( attributeName ),
      attributeName,
      mandatory
  );
}
origin: hibernate/hibernate-orm

public Annotation[] getAnnotations() {
  initAnnotations();
  return annotations;
}
origin: hibernate/hibernate-orm

protected JPAOverriddenAnnotationReader getReader(Class<?> entityClass, String fieldName, String ormResourceName)
    throws Exception {
  AnnotatedElement el = getAnnotatedElement( entityClass, fieldName );
  XMLContext xmlContext = getContext( ormResourceName );
  return new JPAOverriddenAnnotationReader( el, xmlContext, BootstrapContextImpl.INSTANCE );
}
origin: hibernate/hibernate-orm

private ExcludeSuperclassListeners getExcludeSuperclassListeners(Element tree, XMLContext.Default defaults) {
  return (ExcludeSuperclassListeners) getMarkerAnnotation( ExcludeSuperclassListeners.class, tree, defaults );
}
origin: hibernate/hibernate-orm

private List<AttributeOverride> buildAttributeOverrides(Element element, String nodeName) {
  List<Element> subelements = element == null ? null : element.elements( nodeName );
  return buildAttributeOverrides( subelements, nodeName );
}
origin: hibernate/hibernate-orm

public void applyDiscoveredAttributeConverters(AttributeConverterDefinitionCollector collector) {
  for ( AttributeConverterInfo info : attributeConverterInfoList ) {
    collector.addAttributeConverter( info );
  }
  attributeConverterInfoList.clear();
}
origin: hibernate/hibernate-orm

/**
 * @param mergeWithAnnotations Whether to use Java annotations for this
 * element, if present and not disabled by the XMLContext defaults.
 * In some contexts (such as an association mapping) merging with
 * annotations is never allowed.
 */
private AttributeOverrides getAttributeOverrides(Element tree, XMLContext.Default defaults, boolean mergeWithAnnotations) {
  List<AttributeOverride> attributes = buildAttributeOverrides( tree, "attribute-override" );
  return mergeAttributeOverrides( defaults, attributes, mergeWithAnnotations );
}
origin: hibernate/hibernate-orm

public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
  initAnnotations();
  return (T) annotationsMap.get( annotationType );
}
origin: hibernate/hibernate-orm

private ExcludeDefaultListeners getExcludeDefaultListeners(Element tree, XMLContext.Default defaults) {
  return (ExcludeDefaultListeners) getMarkerAnnotation( ExcludeDefaultListeners.class, tree, defaults );
}
origin: hibernate/hibernate-orm

public <T extends Annotation> boolean isAnnotationPresent(Class<T> annotationType) {
  initAnnotations();
  return annotationsMap.containsKey( annotationType );
}
org.hibernate.cfg.annotations.reflection

Most used classes

  • XMLContext
    A helper for consuming orm.xml mappings.
  • JPAMetadataProvider
    MetadataProvider aware of the JPA Deployment descriptor
  • XMLContext$Default
  • JPAOverriddenAnnotationReader
    Encapsulates the overriding of Java annotations from an EJB 3.0 descriptor.
  • JPAOverridenAnnotationReader$PropertyType
  • JPAOverriddenAnnotationReader$PropertyType,
  • AttributeConverterDefinitionCollector
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now