Assuming that no ORM (e.g. Doctrine) is used inside the Repository, my question is what is the proper way of instantiating the Aggregate objects? Is it instantiating the child objects directly inside the Repository and just assign it to the Aggregate Root through its setters or the Aggregate Root is responsible of constructing its child ...
model:
class Product(models.Model):
name = models.CharField(max_length = 128)
(...)
def __unicode__(self):
return self.name
class Receipt(models.Model):
name = models.CharField(max_length=128)
(...)
components = models.ManyToManyField(Product, through='ReceiptComponent')
def __unicode__(self):
return self.nam...
There is a website that my company uses that updates information about 3 specific things throughout the day. We use the information from 1 of them and what we are wanting to do is pull this information as it is added to their site and add it to a page of our own to view easier. Is this even possible? Can anyone point me in the direction ...
Given a CoreData-Entity with an date (days) and an ammount called Transaction.
Is it with CoreData possible (and how) to aggregate/group the 'table' (with all Transactions) by Date and calculate the sum of the day in a second column/attribute?
(the SQL-Solution would be SELECT date, sum(ammount) FROM transaction GROUP BY date)
...
I'd like to build a website that aggregates and displays content from hundreds of RSS feeds. The feeds will be from different sites: Twitter, Flickr, Tumblr, etc, so the content will be very heterogenous.
In a perfect world — and this is more of a side issue — I would like to allow other people to help manage the list of feeds and assi...
The standard SQL aggregate function max() will return the highest value in a group; min() will return the lowest.
Is there an aggregate function in Oracle to return a random value from a group? Or some technique to achieve this?
E.g., given the table foo:
group_id value
1 1
1 5
1 9
2 2
2 4
2 8...
i have a table in which there are ids and resigning dates.
a singlle id have more than one resigning date.
how can i display the table in which one id have only one resigning date which is the latest ie the maximum date.
can somebody help me plzz....thanx a ton
...
I am using ASP.NET MVC2 and I would like to make up a url based on the current one in the address bar inside a HtmlHelper extension. So far I have this:
url = helper.ViewContext.RequestContext.RouteData.Values
.Aggregate<KeyValuePair<String, Object>>((w, next) => w + next);
But that does not compile. Anyone has a good idea on h...
Hi,
I'm currently determining the entities, value objects and aggregates in a system. Say the following Entities have been identified:
Customer, CustomerEmail, Email, CustomerAddress, Address, AddressType
where Customers -> Emails is a many to many relationship, as is Customers -> Addresses (with an address type). These relationships ...
I have a table like
date user_id page_id
2010-06-19 16:00:00 1 4
2010-06-19 16:00:00 3 4
2010-06-20 07:10:00 1 1
2010-06-20 12:00:10 1 2
2010-06-20 12:00:10 1 3
2010-06-20 13:05:00 2 ...
I have a table schema similar to the following (simplified):
CREATE TABLE Transactions
(
TransactionID int NOT NULL IDENTITY(1, 1) PRIMARY KEY CLUSTERED,
CustomerID int NOT NULL, -- Foreign key, not shown
TransactionDate datetime NOT NULL,
...
)
CREATE INDEX IX_Transactions_Customer_Date
ON Transactions (CustomerID, Tr...
Hi All,
I have this small table of data.
Dir LinkL LinkH
East 19 27
East 27 29
East 29 31
West 46 49
West 49 51
West 51 61
These represent possible trips. How can I query this? For instance if you started at station 19, you could go from 19->27, 19->29, and 19->31. Three possible "trips" But starting from 2...
You cannot (should not) put non-aggregates in the SELECT line of a GROUP BY query.
I would however like access the one of the non-aggregates associated with the max. In plain english, I want a table with the oldest id of each kind.
CREATE TABLE stuff (
id int,
kind int,
age int
);
This query gives me the information I'm aft...
I have two tables,
jobcli
client_id
job_id
jobs
job_id
jobTitle
startDate
projectmgr
What I am having trouble with is to display client_id, job_id, jobTitle, startDate, and projectmgr in a query, where the results are grouped by client_id and have max of date.
So far I can get a list that's groupped by client_id with their c...
Hi, I have a model which looks like this:
class MyModel(models.Model)
value = models.DecimalField()
date = models.DatetimeField()
I'm doing this request:
MyModel.objects.aggregate(Min("value"))
and I'm getting the expected result:
{"mymodel__min": the_actual_minimum_value}
However, I can't figure out a way to get at the ...
The query below
SELECT
<output name="c.name" title="Name" />,
<output name="c.reference" title="Reference No." />,
<output name="i.idinvoice" title="Invoice ID" />,
<output replace="(SUM(v.quantity * s.charges))/COUNT(i.idinvoice)" />As Invoice
<output replace="p.amount" />AS Amount,
<output replace="p.idpayment" title="Payment ID" />,
...
Hello all
i have a table in SQL 2008 as
ID Items
1 A
1 B
2 C
3 D
3 B
i would like to get the result as
ID Items
1 A,B
2 C
3 B,D
I have used cursors but it has considerably slowed the process , can i achieve the above result using group by query or through any other way.
Thanks and R...
Is there a way to aggregate multiple aggregates to 1 time span?
Dim times = {
New TimeSpan(1, 0, 0),
New TimeSpan(1, 10, 0),
New TimeSpan(1, 50, 0),
New TimeSpan(0, 20, 0),
New TimeSpan(0, 10, 0)
}
Dim sum As New TimeSpan
For Each ts In times
sum = sum.Add(ts)
Next
'That's what I desire:
sum = times.Sum
sum = times.Aggreg...
I’m struggling designing this system where an address is the most central piece of information. Now in this case, an address is not just a few lines of strings. We’re storing municipalities (code, name), district (post code, name), streets (code, name), house number on a street in a specific district belonging to a municipal. It's a very...
take two following classes:
class Test1{
public:
Test1()=default;
Test1(char in1,char in2):char1(in1),char2(in2){}
char char1;
char char2;
};
class Test2{
public:
Test2()=default;
Test2(char in1,char in2):char1(in1),char2(in2){}
private:
char char1;
char char2;
};
I know in c++0x both of these classes are considered...