subsonic

Subsonic ORM experience

半城伤御伤魂 提交于 2019-12-03 03:18:38
I'm looking for new ORM for a important project, im used to nHibernate with ActiveRecord and I already have a very bad experiencia with EF4, performance and crashing GUI. So search on web I found the Subsonic, i liked what I read in the documentation. So, I would like to know if anyone already used the Subsonic and if the experience was good. Hmm ... well ... how should I put it.... I am currently (as in right now) expending effort to replace SubSonic with PetaPoco . I suppose that says something. It's not that SubSonic was bad exactly, but it didn't fit my way of developing very well. And for

SQL Views in SubSonic 3.0

与世无争的帅哥 提交于 2019-12-03 02:51:42
问题 Is there any way that I can access my SQL views in SubSonic 3.0? The code generation seems to skip views altogether 回答1: To include views in your project simply open SQLServer.ttinclude Find the query that load the tables ( search form 'const string TABLE_SQL') then change it to const string TABLE_SQL=@"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' union select Table_catalog, table_schema, table_name, 'View' table_type from information_schema.views"; if you are using

Java Micro ORM equivalent [closed]

余生颓废 提交于 2019-12-03 00:52:53
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . What would be the closest equivalent in Java to a Micro ORM such as Dapper, PetaPoco, Massive or CodingHorror? 回答1: I recommend Spring JDBC templates. While it's not a "true" ORM, it's a pleasure to use where Hibernate seems to be an overkill. 回答2: sql2o seems like a Dapper alternative - thin wrapper around JDBC

SQL Views in SubSonic 3.0

坚强是说给别人听的谎言 提交于 2019-12-02 16:24:31
Is there any way that I can access my SQL views in SubSonic 3.0? The code generation seems to skip views altogether To include views in your project simply open SQLServer.ttinclude Find the query that load the tables ( search form 'const string TABLE_SQL') then change it to const string TABLE_SQL=@"SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE' union select Table_catalog, table_schema, table_name, 'View' table_type from information_schema.views"; if you are using it in an asp.net project you can exclude the aspnet table and views like so const string TABLE_SQL=@"SELECT *

subsonic 2 join on multiple columns

℡╲_俬逩灬. 提交于 2019-12-02 14:36:15
问题 I want to transfer the following statement to SubSonic 2.2 SELECT b.* FROM tableA a INNER JOIN tableB b ON (a.year = b.year AND a.month = b.monath AND a.userid = b.userid); My problem is that SubSonic's SqlQuery.LeftInnerJoin() command has no overload which takes more than one column. Since any join can be rewritten only using where clauses, I did the following in my sql: SELECT b.* FROM tableA a, tableB b WHERE a.year = b.year AND a.month = b.month AND a.userid = b.userid which should

Java Micro ORM equivalent [closed]

痴心易碎 提交于 2019-12-02 14:16:50
What would be the closest equivalent in Java to a Micro ORM such as Dapper , PetaPoco , Massive or CodingHorror ? I recommend Spring JDBC templates . While it's not a "true" ORM, it's a pleasure to use where Hibernate seems to be an overkill. sql2o seems like a Dapper alternative - thin wrapper around JDBC String sql = "SELECT id, category, duedate " + "FROM tasks " + "WHERE category = :category"; Sql2o sql2o = new Sql2o(DB_URL, USER, PASS); List<Task> tasks = sql2o.createQuery(sql) .addParameter("category", "foo") .executeAndFetch(Task.class); github - https://github.com/aaberg/sql2o site -

Subsonic 3 Union Possible?

こ雲淡風輕ζ 提交于 2019-12-02 12:59:48
问题 I have a schema like so. Menu->Pages->PageRoles->ASPNetRoles Menu has a CategoryID. I want to return all Menu items with a CategoryID of 6. Some Menu items have a foreigh key of PageID. Pages can have 1 or more roles against them. I can check the currently logged in users roles and make sure that they are in the results by joining the tables. I want to return all Menu items with a CategoryID of 6 and for those that have PageID's the users role must be in those roles assigned to the page. The

Separate Read/Write Connection for SubSonic

纵饮孤独 提交于 2019-12-02 11:53:17
问题 The security policy at our client's production environment requires that we use separate connection to execute writes and read to and from database. We have decided to use SubSonic to generate our DAL. So I am interested in knowing if it is possible and if yes how? 回答1: You can specify the provider SubSonic is using at runtime. So you would specify the read provider (using your read connectionstring) when loading from the database and then specify the write provider (using your write

Subsonic 3 Union Possible?

不打扰是莪最后的温柔 提交于 2019-12-02 05:54:10
I have a schema like so. Menu->Pages->PageRoles->ASPNetRoles Menu has a CategoryID. I want to return all Menu items with a CategoryID of 6. Some Menu items have a foreigh key of PageID. Pages can have 1 or more roles against them. I can check the currently logged in users roles and make sure that they are in the results by joining the tables. I want to return all Menu items with a CategoryID of 6 and for those that have PageID's the users role must be in those roles assigned to the page. The only way I can think is to do a union but when I do this in Subsonic it fails. The following works. var

Subsonic 3 + LINQ bug

无人久伴 提交于 2019-12-02 05:29:39
A weird bug with Subsonic 3.0.0.3 Using - as an example - AdventureWorksLT DB When I run this code I get null for gname (although name gets the value ok) And w is 0 instead of the value in the 1st row [If I change select new MyData to just select MyData - it works OK] class Program { static void Main(string[] args) { var q = from g in Product.All() select new MyData{ gname = g.Name, name = g.Name, w = g.Weight.Value }; var list00 = q.Take(1).ToList(); Console.WriteLine(list00[0].gname); } } public class MyData { public string gname { get; set; } public string name { get; set; } public decimal