CakePHP 3 table prefix__ - cakephp-3.0

Is there solution, how to set global prefix for database tables in cakephp3? I found the prefix is not implemented yet.
Is there another solution? Code something to cake libraries on the right place?

No. It's not implementet in Cakephp-3.x so far. But there are some workarounds.
https://github.com/cakephp/cakephp/issues/4118

Related

Mysql naming convention: Should i use past tense in the field name?

Im getting confused on this day fixing the database for having the consistent field name.
When i want to name the field to explain: the name of the one who locked, or hidden the post.
What's the field should i use?
locked_by_username , lock_by_username or lock_username
hidden_by_username , hide_by_username or hidden_username ?
Present tense or past tense? and should i use by inside the field name, does it a bad practice?
I see many database use post_username or poster_username to describe the username of the one who posted the post.
But with lock and hide verb, i can't see any the good way for describing it.
Sorry, i know this is a really stupid question, but English isn't my native language.
Whether your native language is Kiswahili or Klingon or English, what you want here are column names that describe current state. For example username_holding_lock means the column contains the name of a user holding a lock on the row.
Somebody using a tool to troubleshoot by doing SELECT * will then be able to guess what's up when the value TomSawyer appears on some row.
I think this is more opinion based but I generally would use camel case.
I personally would use:
HiddenByUsername
LockedByUsername
A good idea might be to look at some of the Microsoft sample DB's.
A example would be the AdventureWorksDB or you can look here
http://codeplex.com/SqlServerSamples

MySQL Foreign Key Lookup in Editor

I am flummoxed that no one seems to have ever asked this question, which indicates that the question itself is flawed. But, I don't know how to find out the right question, or answer, other than asking, so here goes:
I'm trying out a couple of tools to connect to MySQL databases and view and edit the data. So far I've tried MySQL Workbench and Database Browser. MySQL Workbench seems to be much more robust and lets you set up foreign keys without having to write any SQL.
The problem, though, is that when inserting and updating data in columns that are foreign keys, I have to manually enter the numeric id of the parent row, and once entered, I have to manually look up which record that number refers to if I want to know. Is there no way to set a display field in the parent table and then be able to choose a value off a dropdown menu when editing the child table? phpMyAdmin does this. I'm perplexed that, not only can't I find a way to achieve this in any non-web-based database tool (I've tried Access before, too), but that no one seems ever to have needed to do it before. Am I completely thinking about this wrong? Do people not use these tools to do this type of work? Is everyone writing their own custom lookup interfaces from scratch in Qbasic? Should I memorize all the ids for my parent rows?
Or are people laughing up their sleeves at this question because it's framed so awkwardly?
SQLYog provides such functionality
https://blog.webyog.com/wp-content/uploads/2011/04/FK-Dropdown1.png

Transact-SQL in BO XI?

I recently asked the following question and received a wonderful answer: SQL: Dynamic view with column names based on column values in source table
As someone not familiar at all with BusinessObjects, is there any way to perform this in InfoView? Would I have to edit the universe?
Sorry, I know this is a terrible question... but we're in a bind.
This might be possible via a derived table in the universe. A derived table allows you to write a custom query to provide objects in the universe.
I don't think so. It would require the dynamic creation and destruction of objects.

Hibernate map to views

Is it possible to make maps between beans and views in Hibernate. If there is please someone give show me an example. Thank you
Yes, it's possible. Hibernate doesn't care if the table is an actual table or a view. Just make sure to never update or create instances of such an entity, or mark it as non updatable.

How to make a nested query with an Entity that doesn't really exist (many-to-many)

I'm new with Doctrine2 so my question can be easy to answer (I hope so).
First of all, here the SQL query that I'd want :
SELECT *
FROM Document
WHERE id NOT IN (SELECT document_id FROM Documents_Folders)
Pretty simple isn't it ? The porblem is that my table 'Documents_Folders' is not an entity. In fact, it was create because I have a many-to-many relation between my entities 'Document' and 'Folder'.
I tried several queries, but none worked.
Thanks.
It really does look pretty simple, so it's not the problem with your SQL.
So if you want some help, tell us what is the error that you get?
BTW Your database shouldn't care what you use Documents_Folders for - it's just a table. (I don't know Doctrine2, but it's still regular database underneath, isn't it?)
Out of curiosity, What is your business case here.
Are you trying to get orphaned documents?
A Document can be part of Many Folders and a Folder can have many Documents?