Orm What would you pick for your ASP.NET webapp; nHibernate, Linq, or SubSonic

Something else perhaps? I am already using nHibernate, but I get occasional issues where a lazy initialized proxy object won't actually initialize. I'm thinking of trying something else. The site has user accounts, user posts and photos, and filtering of those to certain location names and title/description matches. Not to mention voting, rating, and marking as a favorite. All of these cause various amounts of db load.

Orm Persisting Collections with Squeryl

How can I persist a collections field (e.g. List[String] or Set[Int]) with Squeryl? What's the best way to encode it such that Squeryl won't create an association table?

What's the difference between an ORM and a Persistence framework?

I'm reading up on OOP design patterns and framework design and find myself a bit unshure about the difference between the terms ORM and Persistence framework. Is an ORM a type of PF? What are the different features you can expect of the two?

Orm Can an Entity access a Repository?

Say I've got two simple entities: User and Review. How bad is it if User calls the Review repository? What is the "clean" way for the User to get its Reviews? class User { public function getReviews() { return reviewRepository.findByUser(this); } } I did have a look at this question, but although they say this is a bad practice, I didn't find an answer there.

Orm How can I map a UInt64 field to a decimal(20, 0) column using Fluent nHibernate?

I'm using MS SQL Server 2008R2 Fluent nHibernate 1.3 nHibernate 3.2 I have a UInt64 field in my domain that potentially takes up the entire UInt64 range. Since MS-SQL doesn't support unsigned integers we decided to store it in a decimal(20,0) column (at least for now). I've tried using CustomSqlType("decimal(20, 0)") on that column in my mappings but I'm still getting an error when I try to access that field that says the database doesn't support UInt64. How can I map a UInt64 field to a d

Orm Deleting entities non-destructively in Symfony2

Is there a good, clean and simple way to delete entities non-destructively in Symfony 2? I'd like to give my administrators a chance to undelete items, while sacrificing as little of the automation provided by the framework as possible. If there is no built-in solution or third party bundle to help me, what would be the best way to do this? Adding a deleted property to entities would require lots of added logic to keep them from cluttering the controllers created by doctrine:generate:crud, so m

Orm Native Query Mapping on the fly openJPA

I am wondering if it is possible to map a named native query on the fly instead of getting back a list of Object[] and then looping through and setting up the object that way. I have a call which I know ill return a massive data set and I want to be able to map it right to my entity. Can I do that or will I have to continue looping through the result set. Here is what I am doing now... List<Provider> ObjList = (List<Provider>) emf.createNativeQuery(assembleQuery(organizationIDs,

Orm No role detected by BjyAuthorize when login

I am working with ZF2, Doctrine ORM and BjyAuthorize. The problem is that when I got logged in the method getRoles of the identity returns empty. class User implements UserInterface, ProviderInterface{ /** * @var \Doctrine\Common\Collections\Collection * * @ORM\ManyToMany(targetEntity="Application\Entity\Role", inversedBy="user") * @ORM\JoinTable(name="user_role_linker", * joinColumns={ * @ORM\JoinColumn(name="user_id", referencedColumnName="user_id")

Orm Laravel 4: Eager loading

I have a table called UserWords that has a word_id column in it, and I want to use that to get the row from the Words table, and kind of concatenate them together like a join. This way each one will have the info from the row in UserWords and Words. I defined the relation like so in UserWord: class UserWord extends Eloquent{ public function word(){ $this->belongsTo('Word'); } } and then after that, I try to get all the UserWords and Words like so: $words = UserWord::with(

Orm method as_array() doesn't work

I'm using idiorm as an ORM library and the method as_array() doesn't work this is my code I get 2 errors 1- $market = $market->as_array(); PHP Fatal error: Call to a member function as_array() on a non-object 2- ->as_array(); PHP Fatal error: Call to a member function as_array() on a non-object My code: function ($market = 'affiliate', $category = array('all')) use ($app) { $market = \ORM::for_table('category') ->where('alias', $market) ->find_one(); $market

Orm Using Kohana to grab specific fields/cells in a table with Model::factory()

I have a website built on the Ushahidi platform that uses the Kohana framework. Currently the site runs on Kohana 2.x. I would like to grab the report title for each report page on my website. The website in question is a number of "report" pages. I'm new to code in general and this is my first time coming across a MVC framework. It sounds good though, as far as I can interpret one can pull info out of the db without writing a sql query but rather by calling it within the view itself. Right?

ZF2 - Working with a one to one join and collections with ORM Doctrine

I am attempting to join two tables. My user table and my user_role_linker table. user table: user_id, name, email... etc. user_role_linker table: user_id, role_id (this is from ZfcUser / BjyAithorize) I am listing my users to a view and I want to include their role in the view. Fortunately the user_role_linker table uses the actual role name as its ID so I only have to do a single join. I have been told to achieve this I need to use a "collection". I have read all about collections in the Doc

ColdFusion: ORM Relationship with LinkTable and Multiple Foreign Keys

My database structure mainly consists of multiple primary keys per table, therefore multiple columns are required per join. I'm trying to use ColdFusion (11 to be specific) ORM relation property that has a linktable. I think the issue is with two keys on one side of the many-to-many relationship and just one on the other. Here is what I've tried without success: Table Setup Staff StaffSites Sites ============ ============ =========== YearID (PK) --- YearID (PK) StaffI

Orm How do I order a relationship in Laravel?

I saw this question in StackOverflow, but I could not answer it because it was mistakenly marked as duplicate. However $user->posts is not the same as Posts::all(). So if you have User and Post, how do you sort the posts?

Orm Doctrine 2 setParameter not working on string

$query = $em->createQuery('SELECT u FROM Entity\User u where u.first_name = :name'); $query->setParameter('name', 'Fawad'); $users = $query->getResult(); foreach ($users as $items) { echo $items->getId() . " " . $items->getFirstName() . "<br>"; }

Orm How do I check the result of a Fat Free Mapper call to save a DB record?

I'm using the SQL Mapper to update records in my MYSQL DB which is working ok - but I can't see how to check what the outcome of the update was from the call to save() or update(). Update seems to return the entire mapper object which doesn't offer an obvious way of checking if the update failed. Should I be checking the return code or catching an exception? Any help appreciated! Matt

Orm DapperContrib - Update using Abstract Class

I have a bass class like this: public abstract class Document { [Dapper.Contrib.Extensions.Key] public Int32 DoucmentID {get;set;} public String Name {get;set;} } Then I have public class Proposal : Document { public String ProposalStuff {get;set;} } Now I want to write some generic method to handle updates using Dapper.Contrib //some class somewhere.. public bool Update<T> (T as item) where T : class { using (var sqlConnection = new SqlConnection(_connectionString))

Using $_has_many in Kohana's ORM model

So I'm trying to learn Kohana, and I've hit quite a snag when it comes to their ORM module. When trying to set up a one-to-many ORM object, I am able to update/insert the information from my parent model, but it won't allow me to associate ( insert/update ) any new children. For clarity's sake, here is my database structure... recipes --id --recipe --directions --servings ingredients --id --recipe_id --amount --serving items --id --item ...my models... class Model_Recipe extends ORM {

Orm How do I map lists of nested objects with Dapper

I'm currently using Entity Framework for my db access but want to have a look at Dapper. I have classes like this: public class Course{ public string Title{get;set;} public IList<Location> Locations {get;set;} ... } public class Location{ public string Name {get;set;} ... } So one course can be taught at several locations. Entity Framework does the mapping for me so my Course object is populated with a list of locations. How would I go about this with Dapper, is it even

Mapping for component xxx not found in ORM app

I'm doing some TDD with a ColdFusion ORM application so I'm letting the application.cfc in my tests directory so I'm setting dbcreate="update" so the tests will create the database tables. Every time I change a model's method and re-run my tests I get the following error: Mapping for component models.user.User not found. If I restart the server the error goes away, however this is a terrible workflow so I'm looking for a better way to fix this problem.

Orm generate geo tiles from vector data

i am facing this problem : I have in my database some vector data (polylines ...) which describe many world/country/region/cities boundaries. I would like to have an interactive map on thoses areas. When i render those data in the browser (data are sent in geojson) this is slow (i'am not surprised). The next reason, is to generate some raster tiles to represent the areas at different zoom level and to have a way to make the relation between a click on a area and the area selected (to display

Orm How to return an EntityBase2 from a string?

I have a ListBox that is populated with my entity names, i.e. A1AllocationHelp1Entity On select I need to pass that string name to get an EntityBase2 type. I can get it using reflection: Public Function CreateEntity(ByVal entityName As String) As EntityBase2 Dim myAssembly = Assembly.LoadFrom(DALFileName) Dim assemblyName = Split(dynamicAssembly.FullName, ",")(0) Dim myEntityName = assemblyName & ".EntityClasses." & entityName Dim handle = Activator.CreateInstance(asse

Orm Using JMSSerialize to serialize Doctrine2 Entities that follow SimplifiedYamlDriver convention

The symfony sponsored project \Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver is really useful in my project to keep Entity file names clean and simple. However, JMSSerialize assumes that the naming convention for each Entity is the fully qualified namespace. This is not true when using \Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver in your Doctrine2 Configuration. (http://docs.doctrine-project.org/en/latest/reference/yaml-mapping.html) <?php $namespaces = array( '/path/to/files1' =&

Orm PRISMA: Getting type error on where clause in update method

Have a specific Prisma ORM library error that I need help with. I have created a migration and pushed it to a postgres db. I have generated the client model for Prisma and am able to findAll and insert data using the create method. Where I am having trouble is the update method. Here's my code app.post("/articles/:title", async (req: Request, res: Response) => { const article = await prisma.article.update({ where: { title: req.params.title }, data: { title: req.body.title,

Query Builder vs. ORM?

What is the difference between a query builder and an ORM that developers use in their backend server-side code/logic for interacting with their database? It seems like the query builder can fulfill the goal of coding in the same language you are choosing to write the backend server-side code/logic to work with the database. However, I don't understand why an ORM comes in the picture then.

OpenAccess ORM Fluent API

Suppose I have an assembly A which has all the entities and mappings using fluent api. this assembly needs enhancing, I get it. but what happens to the assembly which is using assembly A. does it need enhancing too? thanks

Orm J2SE desktop applications - JPA database vs Collections?

I come from a web development background and haven't done anything significant in Java in quite some time. I'm doing a small project, most of which involves some models with relationships and straightforward CRUD operations with those objects. JPA/EclipseLink seems to suit the problem, but this is the kind of app that has File->Open and File->Save features, i.e. the data will be stored in files by the user, rather than persisting in the database between sessions. The last time I worked on a p

Orm How do I use this indirect relationship?

I'm working on incorporating a reputation system into my site, similar to SO. Here is how it is structured: User hasMany Project User hasMany Answer Project hasMany Rating Answer hasMany Rating Rating belongsTo Project where Rating.parent_type = Project Rating belongsTo Answer where Rating.parent_type = Answer Rating's value field will be a number between 1 and 5. The user should gain +10 for every 5-star review, +5 for every 4-star review, and +1 for every 3-star review. The way I currently h

Orm Best way to mimic inheritance in postgresql?

For an application I am writing, there are two types of "users", those who have made accounts and those who have not, virtual_users. These two types are nearly identical, except account_users have a password, and email is required and must be unique amongst all account_users, although it can be the same as any number for virtual_users. A large number of tables have a column that references users, which should include both, and 90% of app functionality treats them as interchangeable. What is the

Cleanup Transfer ORM definitions?

Started researching Transfer ORM recently and find it pretty cool. Today I've noticed that definitions directory contains some old files from my previous development sessions (ex. 27/08, 28/08). I have only few objects in transfer.xml for that project, but they produced few definition files each already. Should I worry about them? Maybe the only reason is that object XML changes, so it's development-only issue. Will Transfer cleanup these after some period or I should set up the script to

Orm Strategic issue: Mixing relational and non-relational db?

There has been a lot of talk about contra-revolutionary NoSQL databases like Cassandra, CouchDB, Hypertable, MongoDB, Project Voldemort, BigTable, and so many more. As far as I am concerned, the strongest pros are scalability, performance and simplicity. I am seriously considering to suggest using some non-relational db for our next project. However, some teams comprise some RDBMS fanatics, so convincing a hard switch might be impossible in some cases just because of emotional reasons. Also, w

How do I convert an entity from one type to another in ColdFusion ORM?

Let's say I have three entities, Company, StandardCompany, and CompanyTemplate, where Company is the base class for the other two: Company /\ / \ / \ StandardCompany CompanyTemplate And the component mappings: component name="Company" mappedSuperClass="true" { property name="Name"; } component name="StandardCompany" persistent="true" extends="Company" { property name="Owner"; } component name="CompanyTempla

Orm Fluent API Many to Many Mapping Error

I have the following mapping to support a many to many table (User_Role) modelBuilder.Entity<Role>() .HasMany<User>(u => u.users) .WithMany(r => r.roles) .Map(m => m.MapLeftKey("role_id") m.MapRightKey("user_id") m.ToTable("User_Role")); This works great from mapping many roles to a user and many users to a role. The problem I am having is when I need to add a new row to the table User_Role via an entity as fo

Orm Symfony2 mapping onetomany manytone

I am developing an application using symfony2 and using orm.yml files for mapping the entities into the database. The problem comes when trying to create the database tables for two entities that share a onetomany relationship (Anotatzea.php and Dokumentua.php). When running php app/console doctrine:schema:update --force it shows the next error [RuntimeException]

ORMExecuteQuery() count seems to return an array

ORMExecuteQuery() seem to return an array for the following example = ormExecuteQuery("select count(commentID) as n from pComment c"); output uing cfdump for example would be... array [1][x] where x is count. How can I just get n as a number and not an array object returned? I want to just getn()

Orm Weird error: [Semantical Error] line 0, col 75 near 'submit': Error: 'submit' is not defined

My controller is: /** * @Route("/product/submit", name="product_submit") * @Template("GaorenVendorsBundle:Product:index.html.twig") */ public function submitAction() { $em = $this->getDoctrine()->getManager(); $uid = $this->getUser()->getId(); $em->getRepository( 'GaorenVendorsBundle:Product' )->updateStatus( $uid, Product::STATUS_FREE, Product::STATUS_PENDING ); return $this->redirect( $this->generateUrl( 'product' ) );

Orm how can i define relationship for my models in flask

am new to flask and ORM technology am doing one sample project for my learning in my application a trainer can teach one or more technologies, so I define my tables as bellow Trainer: id name phone email technology: id tech_name assert: id trainer_id technology_id and can any one help me how to convert above table definitions into models with proper relationship Thanks in advance

Orm Doctrine2: Double relation to 1 entity

I have 2 entities: Album and AlbumImages. I've made annotations like this: Entity\Album /** * * @var Collection * * @ORM\OneToMany(targetEntity="AlbumImages", mappedBy="album", cascade={"persist", "remove", "merge"}, orphanRemoval=true) */ protected $images; Entity\AlbumImages /** * * @var Album $album * * @ORM\ManyToOne(targetEntity="Album", inversedBy="images") */ protected $album; It works as expected. Each Album have a

Laravel 4 / Eloquent ORM: Only Objects with relational Objects

ive got products an articles. An article belongs to a product, so ive got the hasMany-Relationship in my product class and the belongsTo relation in my article class. Ok now i can grab all articles of a certain product. But what i need is the following: I want to display only the products which got at least one article. Do i have to use a db-query for that or can i use the eloquent mechanisms for that? Thanks in advance. regards

Laravel eloquent ORM beginner

I try to make a simple request. Suppose logged user have "projects". And suppose "projects" have many "comment". I try to get all project from user with all comment by project. I have table called "users", "projects", "comments". Users is managed by Sentry. I have two models : Project and Comment : class Project extends Eloquent { ... } class Comment extends Eloquent { ... } In my Model "Project" I have this : public function

Orm Eager Loading Laravel Eloquent

I have a quick and straightforward question. Which of the following queries is preferred while working with Eloquent ORM in Laravel? $post = Post::with(array('user', 'comments.from'))->find($id); $post = Post::with(array('user', 'comments.from'))->where('postID', $id)->get(); I'm struggling to find the difference between ->find and ->get with eager loading. postID is my primary key in the posts table above. Both performance are nearly identical via my debugger and each run 8 queries

Jaguar orm - reflexive relationship

Does jaguar_orm support reflexive relationships? I have a Category class that can be part of another Category: class Category { /// constructor Category(); Category.make(this.id, this.name); /// fields @PrimaryKey() int id; @Column(isNullable: false) String name; @BelongsTo(CategoryBean, isNullable: true, refCol: 'id') int parentCategoryId; /// database // String toString() => "Product($id, $name, $parentCategoryId)"; String toString() => "Product($id, $name)

Dynamic property defaults in CF9 ORM

How do you set up dynamic property defaults on CF9 ORM objects? For instance, I know I can set a property default like this: property name="isActive" default="1"; But what if you want to have a dynamically generated default, such as a date or a UUID? property name="uuid" default="#createUUID()#"; ...throws an error - so what's the workaround for this?

F# and ORM tool

I would like to know your best experiences with F# and ORM tool. Is F# + LINQ 2 SQL having some intricacies?

Orm How can I discard non-flushed changes to an entity in Doctrine 2?

I used SQL-queries-based database access level for a long time. But now I decided to use ORM Doctrine2. At this moment I have one conceptual misunderstanding of entities workflow. Best described by example: try { $user = $entityManager->find('User', 1); $user->setName('New name'); $entityManager->flush(); } catch (...) { // !we are here: changes failed and $user-row in DB was not updated } // ... $user = $entityManager->find('User', 1); $user->setOther('Oth

Orm Symfony2-Doctrine: ManyToMany bi-directionnal relation

I've already search a lot befors asking, even the related topic Symfony2-Doctrine: ManyToMany relation is not saved to database but still no answer. I've got this two classes: class Intervenant extends User { /** * @ManyToMany(targetEntity="iMDEO\DISAASBundle\Entity\Domaine", inversedBy="intervenants", cascade={"persist","merge"}) */ private $domaines; /** * Add domaines * * @param Domaine $domaines */ public function addDomaine(Domaine $domaines) { $this->domaines[] = $domain

Orm Foreign key value not inserting in database: Cannot insert Null in column

I am migrating client application from Hibernate to EclipseLink. But it is not inserting value for foreign key when calling persist method on student entity. Database is oracle. There is Many to one relation between Address and Student. Also in generated SQL the foreign key column is not present. @Entity @Table(name = "Student", schema = "Student_DB") @SequenceGenerator(name = "studentSeq", sequenceName = "Student_SEQ", schema = "Student_DB", allocationSize = 1) public class StudentEntity impl

  1    2   3   4   5   6  ... 下一页 共 6 页