﻿using Code;

namespace LibDatabaseCodeMaker.Database
{
	/// <summary>
	/// 数据库的操作
	/// </summary>
	public abstract partial class BasicDatabase
	{
		/// <summary>
		/// 创建Java对象
		/// </summary>
		public abstract void CreateJava();

		/// <summary>
		/// Java
		/// </summary>
		public class Java : Language
		{
			/// <summary>
			/// 获取数据库连接字符串
			/// </summary>
			public string ConnectionUrl { get; set; }

			/// <summary>
			/// 获取数据库驱动名称
			/// </summary>
			public string Driver { get; set; }

			/// <summary>
			/// 构造函数
			/// </summary>
			/// <param name="database">数据库对象</param>
			/// <param name="connurl">数据库连接的URL</param>
			/// <param name="driver">数据库驱动名称</param>
			public Java(BasicDatabase database, string connurl, string driver)
			{
				Database = database;
				Name = Formatter.Java.ToVariableString(Database.Name);
				ConnectionUrl = connurl;
				Driver = driver;
			}

			/// <summary>
			/// 获取连接字符串(需要写双引号)或者保存连接字符串的变量/常量
			/// </summary>
			/// <returns>连接字符串(需要写双引号)或者保存连接字符串的变量/常量</returns>
			public override string GetConnectionString()
			{
				return "mConnectionString";
			}
		}
	}
}
