首页 \ 问答 \ 在HNibernate中使用代码映射忽略列(Ignore column using mapping by code in HNibernate)

在HNibernate中使用代码映射忽略列(Ignore column using mapping by code in HNibernate)

我在NHibernate中使用代码映射。 我有一个有几个属性的类。 其中之一与DB中的任何列无关,但仍有getter和setter。

我使用ConventionModelMapper而不是ModelMapper。 第一个假设所有属性都被映射。

我可以告诉NHibernate忽略它?


I'm using mapping by code in NHibernate. I got a class with several properties. One of them is not related to any columns in DB but still has getter and setter.

I use ConventionModelMapper not ModelMapper. The first one assumes that all properties are mapped.

How i can tell to NHibernate to ignore it?


原文:https://stackoverflow.com/questions/7658647
更新时间:2023-08-24 13:08

最满意答案

错误'C:/ wamp / www'@'localhost'告诉你试图连接的用户是'C:/ wamp / www',而不是'root'。 你可以通过打印出来来检查$ dbconfig中的内容吗?

在phpmyadmin配置中更改密码实际上并不会从数据库本身更改密码。 Phpmyadmin只是一个客户端,而不是数据库。

要更改数据库中的密码,您应该使用任何客户端(如phpmyadmin)在'mysql'数据库'用户'表中更改它:

  1. 从phpmyadmin配置中删除用户名和密码 - 它将允许您使用网络形式登录。

  2. 打开phpmyadmin并使用默认的用户名/密码对。 默认情况下,它很可能是'root',没有密码。

  3. 转到users表,使用'localhost'主机搜索'root'用户并将密码更改为PASSWORD('father2242')

  4. 保存行

  5. 重新启动MySQL服务

之后的一切都应该起作用 - 你将允许root用户使用你选择的密码从本地主机访问。


Error 'C:/wamp/www'@'localhost' tells that user you try to connect with is 'C:/wamp/www', not 'root'. Could you check what is actually inside $dbconfig by printing it out?

Changing password in phpmyadmin config doesn't actually change password from database itself. Phpmyadmin is just a client, not database.

To change password from database you should change it in 'users' table in 'mysql' database using any client (like phpmyadmin):

  1. Remove username and password from phpmyadmin config - it will allow you to login using web-form.

  2. Open phpmyadmin and use default user/password pair. Most likely it is 'root' without password by default.

  3. Go to users table, search for 'root' user with 'localhost' host and change password to PASSWORD('father2242')

  4. Save row

  5. Restart MySQL service

Everything should work after that - you will have root user allowed to access from localhost with password you chose.

相关问答

更多
  • 错误'C:/ wamp / www'@'localhost'告诉你试图连接的用户是'C:/ wamp / www',而不是'root'。 你可以通过打印出来来检查$ dbconfig中的内容吗? 在phpmyadmin配置中更改密码实际上并不会从数据库本身更改密码。 Phpmyadmin只是一个客户端,而不是数据库。 要更改数据库中的密码,您应该使用任何客户端(如phpmyadmin)在'mysql'数据库'用户'表中更改它: 从phpmyadmin配置中删除用户名和密码 - 它将允许您使用网络形式登录。 ...
  • 您需要在WAMP环境中设置新的root密码。 它有一个与XAMPP中不同的MySQL实例,因此它不会获取相同的root密码。 更改root密码并再次尝试连接,这应该有效。 You need to set a new root password within your WAMP environment. It has a different instance of MySQL to the one in XAMPP, so it won't pick up the same root password. Ch ...
  • 在Moodle文件夹中的“Config.php” 78.10*.***.*** (wwwroot='localhost')更改为78.10*.***.*** 。 要使moodle文件夹成为根目录,请执行以下操作: 您将需要在httpd.conf文件/wamp/apache2/conf/httd.conf中编辑两件内容: DocumentRoot "/wamp/www" 改成 DocumentRoot "your_moodle_folder" 然后找到: 改 ...
  • 在你的phpmyadmin config.inc.php中尝试这个: - $cfg['Servers'][$i]['verbose'] = 'localhost'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = '3306'; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] ...
  • 在这里看到我的老指导,我的许多朋友有这个错误,这个指南的工程http://www.hieule.info/site/web/solve-the-denied-access-problem-when-using-wamp-server-2 -on-windows-8-希望这也适用于你。 See my old guide here, many of my friend has this error and this guide works http://www.hieule.info/site/web/solv ...
  • 它不是特别安全,但如果您将帐户名称添加到my.ini文件以及密码,它将适合您 # The following options will be passed to all MySQL clients [client] user = "Fred" password = "Bloggs" port = 3306 socket = /tmp/mysql.sock ... Its not particularly secure but if you add the acc ...
  • 解决这个问题的最佳方法是在我看来重新安装Drupal。 似乎数据库创建错误,您的用户表已损坏。 尝试通过仪表板创建另一个用户,然后在settings.php中更改root用户的值。 在$ database变量中。 它可能会解决您的问题。 问候。 The best way to fix it is re-installing Drupal, in my opinion. It seems the Database has created wrong, and your users table is corru ...
  • 所以我在谷歌上搜索,但我没有尝试过。 所以我继续Youtube,在那里我找到了答案。 我会在这里发布Youtube密码视频链接,因为它比解释更容易,但我会给出一个简短的总结。 它是通过命令行完成的,并生成一个名为“mysql-init.txt”的.txt文件。 所以我必须创建一个.txt文件,其中包含使用mysql的命令并更新mysql.user表,并更新密码,然后刷新权限。 然后不得不关闭mysql服务器服务。 之后,我将“my.ini”文件移动到mysql服务器的文件夹中(对我来说是“MySQL Ser ...
  • 当您安装WAMP时,它会附带一个标准的MySQL安装。 MySQL的标准用户是root ,没有密码。 在您添加自己的用户ashish ,您需要以root身份登录并添加此用户(或者只使用root用于测试)。 When you install WAMP, it comes with a standard install of MySQL. The standard user for MySQL is root and there is no password. Before you can add your o ...
  • 编辑config.inc.php文件。 $cfg['Servers'][$i]['verbose'] = 'localhost'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['port'] = '3306'; $cfg['Servers'][$i]['socket'] = ''; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['extensi ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。