The specific provisions in your lease agreement will determine when and how your landlord can enter your apartment. A typical California lease includes a provision that does require a landlord to provide 24 hours notice before entering a tenant's apartment.
If you would like to find out who owns the building, you can go to the County Recorders office and provide them an address and ask for the most recent deed for that property. There is a fee for obtaining these copies.
Yes--there is a law--Civil Code section 1954. Section 1954 provides that a landlord must give his tenants 24 hours WRITTEN notice before he can enter the apartment to make repairs. Note that the repairs must be "necessary and agreed" repairs.
The lawyer that advised that you look to your lease to determine the landlord's right to enter is wrong. No matter what it says in the lease, the lease provisions do not control because you cannot waive your rights under Section 1954 to 24 hours written notice. It is against the public policy of the State of California.
Many leases contain illegal provisions in them that are unenforceable. For instance, some leases state that the tenant waives his or her right to trial by jury. This too is an unenforceable provision.
Yes, there is a code section that requires 24 hour notice before entering the apartment, but the lease can require more notice that 24 hours. Look to the lease to see of the notice period is longer than 24 hours. If the provision in the lease requires more than 24 hour notice, the provision is enforceable.