Package org.hibernate.annotations

Examples of org.hibernate.annotations.AnyMetaDef


      EntityBinder entityBinder,
      boolean optional,
      Mappings mappings) {
    //All FK columns should be in the same table
    Any value = new Any( mappings, columns[0].getTable() );
    AnyMetaDef metaAnnDef = inferredData.getProperty().getAnnotation( AnyMetaDef.class );

    if ( metaAnnDef != null ) {
      //local has precedence over general and can be mapped for future reference if named
      bindAnyMetaDefs( inferredData.getProperty(), mappings );
    }
    else {
      metaAnnDef = mappings.getAnyMetaDef( anyMetaDefName );
    }
    if ( metaAnnDef != null ) {
      value.setIdentifierType( metaAnnDef.idType() );
      value.setMetaType( metaAnnDef.metaType() );

      HashMap values = new HashMap();
      org.hibernate.type.Type metaType = mappings.getTypeResolver().heuristicType( value.getMetaType() );
      for (MetaValue metaValue : metaAnnDef.metaValues()) {
        try {
          Object discrim = ( (org.hibernate.type.DiscriminatorType) metaType ).stringToObject( metaValue
              .value() );
          String entityName = metaValue.targetEntity().getName();
          values.put( discrim, entityName );
View Full Code Here


    }
    return value;
  }

  public static void bindAnyMetaDefs(XAnnotatedElement annotatedElement, Mappings mappings) {
    AnyMetaDef defAnn = annotatedElement.getAnnotation( AnyMetaDef.class );
    AnyMetaDefs defsAnn = annotatedElement.getAnnotation( AnyMetaDefs.class );
    boolean mustHaveName = XClass.class.isAssignableFrom( annotatedElement.getClass() )
        || XPackage.class.isAssignableFrom( annotatedElement.getClass() );
    if ( defAnn != null ) {
      checkAnyMetaDefValidity( mustHaveName, defAnn, annotatedElement );
View Full Code Here

  public static Any buildAnyValue(String anyMetaDefName, Ejb3JoinColumn[] columns, javax.persistence.Column metaColumn, PropertyData inferredData,
                  boolean cascadeOnDelete, Nullability nullability, PropertyHolder propertyHolder,
                  EntityBinder entityBinder, boolean optional, ExtendedMappings mappings) {
    //All FK columns should be in the same table
    Any value = new Any( columns[0].getTable() );
    AnyMetaDef metaAnnDef = inferredData.getProperty().getAnnotation( AnyMetaDef.class );

    if ( metaAnnDef != null ) {
      //local has precedence over general and can be mapped for future reference if named
      bindAnyMetaDefs( inferredData.getProperty(), mappings );
    }
    else {
      metaAnnDef = mappings.getAnyMetaDef( anyMetaDefName );
    }
    if ( metaAnnDef != null ) {
      value.setIdentifierType( metaAnnDef.idType() );
      value.setMetaType( metaAnnDef.metaType() );

      HashMap values = new HashMap();
      org.hibernate.type.Type metaType = TypeFactory.heuristicType( value.getMetaType() );
      for (MetaValue metaValue : metaAnnDef.metaValues()) {
        try {
          Object discrim = ( (org.hibernate.type.DiscriminatorType) metaType ).stringToObject( metaValue
              .value() );
          String entityName = metaValue.targetEntity().getName();
          values.put( discrim, entityName );
View Full Code Here

    }
    return value;
  }

  public static void bindAnyMetaDefs(XAnnotatedElement annotatedElement, ExtendedMappings mappings) {
    AnyMetaDef defAnn = annotatedElement.getAnnotation( AnyMetaDef.class );
    AnyMetaDefs defsAnn = annotatedElement.getAnnotation( AnyMetaDefs.class );
    boolean mustHaveName = XClass.class.isAssignableFrom( annotatedElement.getClass() )
        || XPackage.class.isAssignableFrom( annotatedElement.getClass() );
    if ( defAnn != null ) {
      checkAnyMetaDefValidity( mustHaveName, defAnn, annotatedElement );
View Full Code Here

  public static Any buildAnyValue(String anyMetaDefName, Ejb3JoinColumn[] columns, javax.persistence.Column metaColumn, PropertyData inferredData,
                  boolean cascadeOnDelete, Nullability nullability, PropertyHolder propertyHolder,
                  EntityBinder entityBinder, boolean optional, ExtendedMappings mappings) {
    //All FK columns should be in the same table
    Any value = new Any( columns[0].getTable() );
    AnyMetaDef metaAnnDef = inferredData.getProperty().getAnnotation( AnyMetaDef.class );

    if ( metaAnnDef != null ) {
      //local has precedence over general and can be mapped for future reference if named
      bindAnyMetaDefs( inferredData.getProperty(), mappings );
    }
    else {
      metaAnnDef = mappings.getAnyMetaDef( anyMetaDefName );
    }
    if ( metaAnnDef != null ) {
      value.setIdentifierType( metaAnnDef.idType() );
      value.setMetaType( metaAnnDef.metaType() );

      HashMap values = new HashMap();
      org.hibernate.type.Type metaType = TypeFactory.heuristicType( value.getMetaType() );
      for (MetaValue metaValue : metaAnnDef.metaValues()) {
        try {
          Object discrim = ( (org.hibernate.type.DiscriminatorType) metaType ).stringToObject( metaValue
              .value() );
          String entityName = metaValue.targetEntity().getName();
          values.put( discrim, entityName );
View Full Code Here

    }
    return value;
  }

  public static void bindAnyMetaDefs(XAnnotatedElement annotatedElement, ExtendedMappings mappings) {
    AnyMetaDef defAnn = annotatedElement.getAnnotation( AnyMetaDef.class );
    AnyMetaDefs defsAnn = annotatedElement.getAnnotation( AnyMetaDefs.class );
    boolean mustHaveName = XClass.class.isAssignableFrom( annotatedElement.getClass() )
        || XPackage.class.isAssignableFrom( annotatedElement.getClass() );
    if ( defAnn != null ) {
      checkAnyMetaDefValidity( mustHaveName, defAnn, annotatedElement );
View Full Code Here

      EntityBinder entityBinder,
      boolean optional,
      Mappings mappings) {
    //All FK columns should be in the same table
    Any value = new Any( mappings, columns[0].getTable() );
    AnyMetaDef metaAnnDef = inferredData.getProperty().getAnnotation( AnyMetaDef.class );

    if ( metaAnnDef != null ) {
      //local has precedence over general and can be mapped for future reference if named
      bindAnyMetaDefs( inferredData.getProperty(), mappings );
    }
    else {
      metaAnnDef = mappings.getAnyMetaDef( anyMetaDefName );
    }
    if ( metaAnnDef != null ) {
      value.setIdentifierType( metaAnnDef.idType() );
      value.setMetaType( metaAnnDef.metaType() );

      HashMap values = new HashMap();
      org.hibernate.type.Type metaType = mappings.getTypeResolver().heuristicType( value.getMetaType() );
      for (MetaValue metaValue : metaAnnDef.metaValues()) {
        try {
          Object discrim = ( (org.hibernate.type.DiscriminatorType) metaType ).stringToObject( metaValue
              .value() );
          String entityName = metaValue.targetEntity().getName();
          values.put( discrim, entityName );
View Full Code Here

    }
    return value;
  }

  public static void bindAnyMetaDefs(XAnnotatedElement annotatedElement, Mappings mappings) {
    AnyMetaDef defAnn = annotatedElement.getAnnotation( AnyMetaDef.class );
    AnyMetaDefs defsAnn = annotatedElement.getAnnotation( AnyMetaDefs.class );
    boolean mustHaveName = XClass.class.isAssignableFrom( annotatedElement.getClass() )
        || XPackage.class.isAssignableFrom( annotatedElement.getClass() );
    if ( defAnn != null ) {
      checkAnyMetaDefValidity( mustHaveName, defAnn, annotatedElement );
View Full Code Here

      EntityBinder entityBinder,
      boolean optional,
      Mappings mappings) {
    //All FK columns should be in the same table
    Any value = new Any( mappings, columns[0].getTable() );
    AnyMetaDef metaAnnDef = inferredData.getProperty().getAnnotation( AnyMetaDef.class );

    if ( metaAnnDef != null ) {
      //local has precedence over general and can be mapped for future reference if named
      bindAnyMetaDefs( inferredData.getProperty(), mappings );
    }
    else {
      metaAnnDef = mappings.getAnyMetaDef( anyMetaDefName );
    }
    if ( metaAnnDef != null ) {
      value.setIdentifierType( metaAnnDef.idType() );
      value.setMetaType( metaAnnDef.metaType() );

      HashMap values = new HashMap();
      org.hibernate.type.Type metaType = mappings.getTypeResolver().heuristicType( value.getMetaType() );
      for (MetaValue metaValue : metaAnnDef.metaValues()) {
        try {
          Object discrim = ( (org.hibernate.type.DiscriminatorType) metaType ).stringToObject( metaValue
              .value() );
          String entityName = metaValue.targetEntity().getName();
          values.put( discrim, entityName );
View Full Code Here

    }
    return value;
  }

  public static void bindAnyMetaDefs(XAnnotatedElement annotatedElement, Mappings mappings) {
    AnyMetaDef defAnn = annotatedElement.getAnnotation( AnyMetaDef.class );
    AnyMetaDefs defsAnn = annotatedElement.getAnnotation( AnyMetaDefs.class );
    boolean mustHaveName = XClass.class.isAssignableFrom( annotatedElement.getClass() )
        || XPackage.class.isAssignableFrom( annotatedElement.getClass() );
    if ( defAnn != null ) {
      checkAnyMetaDefValidity( mustHaveName, defAnn, annotatedElement );
View Full Code Here

TOP

Related Classes of org.hibernate.annotations.AnyMetaDef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.