FAQ Database Discussion Community


Logging / Tracking CRUD operations in MVC application

asp.net-mvc,logging,log4net,crud,tracking
I want to save all of the CRUD operations with the user's detail to the database and then monitor these info according to the following approach below. In my opinion, the second approach seems better so that it can be managed from one specific table and can also be used...

Sharepoint 2013: CRUD operations on Site Columns

sharepoint,sharepoint-2013,crud,site-column
So far, I'm able to perform CRUD operations on Lists, I was wondering if it is possible to do it on Site Columns, I've try to find it on the web but I literally found nothing, I dediced to drop a question here just to understand if it is possible...

What's the best way to handle recurring tasks like CRUD operations in Java?

java,crud
I'm trying to write classes and methods to minimize recurring tasks. For instance, I'm planning to write a generic DAO (Database Access Object) class in Java which can do the basic crud operations by accpeting the inputdata. For example, the following is a method I just started writing which accepts...

Ruby on rails Crud for routes as namespaces

ruby-on-rails,ruby-on-rails-3,ruby-on-rails-4,crud
I am trying to create crud in rails. I think my routes in the namespace aren't working fine. When I try to create new record(country) it redirects me to index action when the request should go the create action on POST /admin/countries Following is the code: Controller: class Admin::CountriesController <...

Yii2 use own sql query in gridview (gii)

sql,gridview,crud,yii2
I'm fairly new to Yii(2). I need to show the total amount of a single product, ignoring the locations. As shown here: Before: After: Now, I need to show this in the gridview that Gii automatically made. But with my own query inside of it. So instead of this: It...

Symfony2: Deleting record in m:n-relationship

symfony2,many-to-many,crud
I have a problem, while deleting an entry in a m:n-table. I tried this solution, but I get the error: "ContextErrorException: Catchable Fatal Error: Argument 1 passed to Pso\ProjectBundle\Entity\Project::removeUser() must be an instance of Pso\LogBundle\Entity\User, string given, called in C:\xampp\htdocs\pso\src\Pso\ProjectBundle\Controller\ProjectController.php on line 59 and defined in C:\xampp\htdocs\pso\src\Pso\ProjectBundle\Entity\Project.php line 452" I...

Best practices for creating CRUD services in AngularJS

angularjs,crud
What is the best practice for designing CRUD services / factories within an AngularJS application that process single and multiple entities? For example I have a customer object in a factory called customerFactory that contains a structure similar to this: var customer = { newCustomer: false, selfUri: null, editUri: null,...

CRUD in ruby on rails. Routing

ruby-on-rails,ruby-on-rails-3,crud
Working through the "Ruby on rails 3 essential training" I'm encountering an issue with my routes and URL's. I have created a sujects_controller with a 'list' action and a 'show' action. Within my localhost, when I enter in: localhost:3000.subjects/list, I get an error, 'couldn't find Subject with id=list' But, when...

What is correct way to do CRUD operation in JPQL when working with multiple IDs

java,jpa,orm,persistence,crud
I was wondering what is the pereferred/correct way to do operations that involve fetching and removing multiple entity objects? Here's an example: Here's the way that uses IN operator: @Override public void delete(Iterable<Long> ids) { startTransaction(); Query query = getEntityManager().createNamedQuery(Entity.DELETE_ALL_BY_IDS_NQ); query.setParameter(Entity.DELETE_ALL_BY_IDS_PARAMS[0], ids); query.executeUpdate(); endTransaction(); closeTransaction(); } where the named query...

Symfony crud generated index view, where is not have references fields

php,symfony2,doctrine2,crud,symfony-forms
Symfony command doctrine:generate:crud generated controller< form and its views. But, index does not contain other table references fields "many-to-one". Entity model: <?php namespace Acme\Bundle\AdminBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * Albums * * @ORM\Table(name="albums", indexes={@ORM\Index(name="IDX_F4E2474F3D8E604F", columns={"parent"})}) * @ORM\Entity */ class Albums { /** * @var integer * * @ORM\Column(name="id", type="integer",...

How to get user's authorization credentials in code with spring security?

spring,authentication,spring-security,crud
What I'm trying to do is to build CRUD REST service. It will maintain a database of users and theirs records. I'd like to allow users to get access only to their own records. I use Spring Security for authentication and store user's password hashed with Bcrypt. All I can...

Rails Generates Blank Record Even Input Data

ruby-on-rails,crud
I am learning to use CRUD, and setup a page to add a record, however it only generated blank record? Can you take a look my code? thanks! here is the Page controller: class PagesController < ApplicationController def index @test = Page.all end def new @test = Page.new end def...

ExtJS5 MVVC the CRUD ajax proxy does read but not the other

javascript,ajax,extjs,crud
I begin with a little test wich consists on display data from a PostgreSQL in a Grid. The Grid Store has an Ajax Proxy. Here are the codes: model/manage/Client.js Ext.define('Chronos.model.manage.Client', { extend : 'Ext.data.Model', fields : [ {name : 'id', type: 'int'}, {name : 'name', type: 'string'} ] }); store/manage/Client.js...

read data sqlite in android failed

java,android,sqlite,crud
I have a problem in my application, the purpose is to read the data stored in database, but it end up showing the unexpected value. here is my ViewData.class public class ViewData extends ListActivity { //inisialisasi kontroller private DBDataSource dataSource; //inisialisasi arraylist private ArrayList<Wiridan> values; @Override public void onCreate(Bundle savedInstanceState)...

Why doesn't updating a reference update the object?

c#,entity-framework,oop,crud
I have a project with Entity Framework repository pattern to manage objects in a database. I'm wondering why doesn't an object update by passing a new object's reference to it. (question may be a bit inaccurate, but you'll get the picture with the code) My update method is the following:...

Bootstrap modal in React.js

javascript,twitter-bootstrap,crud,reactjs
I need to open a Bootstrap Modal from clicking on a button in a Bootstrap navbar and other places (to show data for a component instance, ie. providing "editing" functionality), but I don't know how to accomplish this. Here is my code: EDIT: Code updated. ApplicationContainer = React.createClass({ render: function()...

Add values before Doctrine Flush

php,symfony2,crud,flush
I would like to add values before flushing. My others values are from a Form which is mapped with my Entity, so when i try to use setData(), my fields stay at "null". Code : public function updateAction(Request $request, $id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('BlogBlogBundle:Blog')->find($id); if (!$entity) {...

Couchbase Sync Function: How to detect the current access type?

rest,crud,restrictions,couchbase-sync-gateway
I am using Couchbase's Sync Gateway and want to restrict the access to the documents. Furthermore, the individual restriction for each document should take into account what is currently happening: The document is just being read or it is either being created or changed in some way. To this end,...

Extjs how to properly return a success msg with more data php

php,extjs,crud
I'm having some issues with the return of my back-end. What I want to do is: I'm looking for some data in my server then I want to return this data with the 'success' response. Problem is, I don't know why, but my grid displays an extra row, with no...

how to handle model crud exceptions

javascript,client-server,crud
A while a ago I started a web application with JavaScript and HTML on the frontend and PHP on the backend. Among others I included backbone.js to my frontend frameworks. I learned that in the client server communication there are 4 different types of operations: create, update, delete and read....

Reading inputs from a html form error

php,html,mysql,database,crud
So I am trying to READ records from a TABLE page but it always lead me to an error 404, my id name is headid. I'm trying to learn crud. I want to view records not in table form, but in a form like a printable form that looks like...

Yii2 - Saving multiple related ActiveRecord models in one form

php,yii2,crud,gii
Here is the table structure: Table BaseTable id (primary key) INT description VARCHAR(255) Table ChildTable id (primary key)(foreign key reference to BaseTable) INT child_property VARCHAR(255) It's a inheritance relation in database table actually. Then I use gii to generate the models with relation function for both, and CRUD operation for...

Is it possible to generate basic CRUD stored procedures on database with code-first entity framework?

c#,.net,entity-framework,stored-procedures,crud
I have searched but couldnt find any useful thing about generating automatically basic CRUD stored procedures when creating the database in code first approach. I am wondering is there a way to do this simply or i should create all the CRUD stored procedure by old fashion?

Basic Xquery CRUD samples equivalent to SQL Select, Insert, Delete or Update [closed]

xquery,crud
I'm an engineer building products and applications traditionally on the RDBMS systems. I'd like to port the applications and products to MarkLogic, this is very convenient and efficient compared to RDBMS technology. However, there are no adequate CRUD examples for me to take off. Can anyone kindly lead me to...

How to work with JPA and Facade?

java,database,jpa,crud
I've a problem with JPA and Facade modell because I don't know how to use it now. I have a class called "Kandidatenstamm" (that's an enitity). For this Kandidatenstamm a Facade and Controller exist. There is also a Abstract Facade and a Abstract Controller. So what do I have to...

How to change search model for using one field

search,crud,yii2
I have CRUD generated bu Gii. By default, the search in app use one field for each table column. How should i change my search model, for make search in all columns via alone field? That's my model: class UserSearch extends User { /** * @inheritdoc */ public function rules()...

Creating an object and assigning it an associated object to it from a different model

ruby-on-rails,ruby,ruby-on-rails-4,activerecord,crud
I have Tools and Projects in my database. Projects belong to Tools & one Tool has one Project. I have numerous Tools already in my database. When creating a Project I want to be able to assign it a Tool as well. The tricky thing is that a Tool is...

decrement a value in view but not database

ruby-on-rails,crud
I have a total value that I would like to keep but I would also like to decrement it every time a certain kind of user creates the resource. For example I have- if @user == "Premium" @resource.decrement!(:total) end But I would also like to show the first :total that...

Deleting a Resource

c#,asp.net-mvc,crud
I have an ASP.NET MVC app. I need to delete a record. In my controller, I have an action that looks like this: [HttpGet] public ActionResult Orders() { return View(); } [HttpDelete] public ActionResult Orders(int orderId) { return RedirectToAction("Orders", new { d = "true" }); } In my view, I...

How i create CRUD with relationships in cakephp3

cakephp,relationship,crud,cakephp-3.0
How i do a crud with a relationship between a user and services order? With the code, i can't add users in a team for service order. When cakebake, the controller TeamHasUsersController is created, but the form add don't have any field. The crud has generated with cake bake. ...

In simple RESTful design, does PATCH imply mapping to CRUD's (ORM's) “update” and PUT to “destroy”+“create” (to replace a resource)?

database,rest,http,orm,crud
I'm trying to create a simple REST API and map it to CRUD. I have an ORM (DataMapper) which has methods like create, update and destroy. If I get it right, given a resource {a:'foo',b:'bar',c:'baz'}, performing a PUT {b:'qux'} is supposed to replace the resource and result in the same...

How do I define CRUD operations in a service (AngularJS)

javascript,angularjs,crud,angular-services
I have a problem with my CRUD operations in the service. When I click on Create Btn it is creating an object but it doesn't push the object in the table list. Ctrl (where's the table list): $scope.nameslist = CrudService.getAll(); Ctrl (for Modal dialog): $scope.createItem = function (newObj) { CrudService.create(newObj);...

is it possible to create CRUD generator in codeigniter just like Yii and CakePHP?

php,codeigniter,codeigniter-2,crud,grocery-crud
previously i worked on Yii framework but after my job change i have to work on codeigniter.but in Yii there is one helper/plugin like when you create database table and once you enter your table in one form and click OK button then it will generate CRUD operation automatically and...

Point of reference for CRUD application in JSF

hibernate,jsf,crud
I am new to programming. This may seem a primitive question. But i need an answer. There are a number of books on JSF / Java. But no one totally explains aspects of a complete application (atleast those that i have gone through). Nor is there any resource available online...

Yii2 GridView - Generate filtered or sorted URL

php,gridview,yii2,crud
I use gii generate the CRUD page of Product, I can access the the list by index.php?r=product and in code, the url is ['/product']. Now I want to access the product index page with filtered parameter and sorted parameter? Is there any tool or standard way to achieve these? For...

can't update entity Symfony2

symfony2,doctrine2,crud
Trying to update my entity, unfortunately didnt use Doctrines generate CRUD feature (have to change stuff I didnt write). I am finally getting data into my form, but it just won't save the changes (also, it doesn't create a new entity as one might suspect). When I click 'save', I...

Error Fatal error: Call to a member function insert() on a non-object

php,mysql,codeigniter,codeigniter-2,crud
I'm using a callback after inserting in the database, to pass values to this other table, i think the method i used its fine. But it gives me this error when its inserting to the other table in the database, probably in my model, or something in the controller im...

What is the best way to use the insert, delete and update from an Content Provider?

android,android-asynctask,android-contentprovider,crud,loader
I am spinning my head around this theme for quite some time. I don't have much experience with Android and I'm trying to code everything using the best approach I can. I successfuly created a Content Provider to wrap my SQLite and some Loaders to query the Data. It works...