public override void VisitHilo(HiloModel model)
        {
            // Attempt to find CollectionID for the property

            CollectionIDModel collModel = FindCollectionID(model.Property);

            if (collModel == null)
            {
                throw new ActiveRecordException(String.Format(
                                                    "A HileAttribute should be used with CollectionIDAttribute, but we couldn't find it for the property " +
                                                    currentModel.Type.FullName + "." + model.Property.Name));
            }

            collModel.Hilo = model;
        }
        public override void VisitCollectionID(CollectionIDModel model)
        {
            // Attempt to find HasAndBelongsToMany for the property

            HasAndBelongsToManyModel hasAndBelModel = FindHasAndBelongsToMany(model.Property);

            if (hasAndBelModel == null)
            {
                throw new ActiveRecordException(String.Format(
                                                    "A CollectionIDAttribute should be used with HasAndBelongsToMany, but we couldn't find it for the property " +
                                                    currentModel.Type.FullName + "." + model.Property.Name));
            }

            hasAndBelModel.CollectionID = model;
        }
Example #3
0
 public override void VisitCollectionID(CollectionIDModel model)
 {
     AppendF("<collection-id {0} {1}>",
             MakeAtt("type", model.CollectionIDAtt.ColumnType),
             MakeAtt("column", model.CollectionIDAtt.Column));
     Ident();
     AppendF("<generator {0}>",
             MakeAtt("class", model.CollectionIDAtt.Generator.ToString().ToLower()));
     Ident();
     base.VisitCollectionID(model);
     Dedent();
     Append("</generator>");
     Dedent();
     Append("</collection-id>");
 }
        /// <summary>
        /// Visits the collection ID.
        /// </summary>
        /// <param name="model">The model.</param>
        public override void VisitCollectionID(CollectionIDModel model)
        {
            // Attempt to find HasAndBelongsToMany for the property

            HasAndBelongsToManyModel hasAndBelModel = FindHasAndBelongsToMany(model.Property);

            if (hasAndBelModel == null)
            {
                throw new ActiveRecordException( String.Format(
                    "A CollectionIDAttribute should be used with HasAndBelongsToMany, but we couldn't find it for the property " +
                    currentModel.Type.FullName + "." + model.Property.Name) );
            }

            hasAndBelModel.CollectionID = model;
        }
Example #5
0
		/// <summary>
		/// Visits the collection ID.
		/// </summary>
		/// <param name="model">The model.</param>
		public override void VisitCollectionID(CollectionIDModel model)
		{
			AppendF("<collection-id{0}{1}>",
			        MakeAtt("type", model.CollectionIDAtt.ColumnType),
			        MakeAtt("column", model.CollectionIDAtt.Column));
			Ident();
			AppendF("<generator{0}>",
			        MakeAtt("class", model.CollectionIDAtt.Generator.ToString().ToLower()));
			Ident();
			base.VisitCollectionID(model);
			Dedent();
			Append("</generator>");
			Dedent();
			Append("</collection-id>");
		}
Example #6
0
 public virtual void VisitCollectionID(CollectionIDModel model)
 {
     VisitNode(model.Hilo);
 }
 /// <summary>
 /// Visits the collection ID.
 /// </summary>
 /// <param name="model">The model.</param>
 public virtual void VisitCollectionID(CollectionIDModel model)
 {
     VisitNode(model.Hilo);
 }
 /// <summary>
 /// Visits the collection ID.
 /// </summary>
 /// <param name="model">The model.</param>
 public override void VisitCollectionID(CollectionIDModel model)
 {
     AppendStartTag("collection-id",
             MakeAtt("type", model.CollectionIDAtt.ColumnType),
             MakeAtt("column", model.CollectionIDAtt.Column));
     Ident();
     AppendStartTag("generator",
             MakeAtt("class", GetCollectionIDGeneratorName(model.CollectionIDAtt.Generator)));
     Ident();
     base.VisitCollectionID(model);
     Dedent();
     Append("</generator>");
     Dedent();
     Append("</collection-id>");
 }